Dangerous exception handling

Description

Browsing through the code I found some unfortunate and possibly dangerous exception handling. I.e. places where we swallow all exception and continue on our way. I.e.

try:
blabala
except: #alternatively except Exceptions...
pass

For example in:
client: _readSessionCache(self):
_main_: setAnnotations
_main_: submit

Also we use except: without the specific type which is too broad handling. In for example:
tables: test_import_pandas
tables: Tables
client: _chunkedUploadFile
client: _uploadStringToFile
retry:_with_retry
utils:is_url
version_check: version_check

Environment

None

Activity

Show:
Larsson Omberg
September 28, 2018, 11:30 PM

Although we still have times where we capture all exceptions and continue, all of them are enclosed in larger retry logic.

Larsson Omberg
September 28, 2018, 11:05 PM

Correct.

Kimyen Truong
September 28, 2018, 10:43 PM

, this issue is more of an improvement to the code base than a bug that affecting users. Validation for this issue should not blocking the release.

Kimyen Truong
August 24, 2018, 12:48 AM

I look for key word pass in each .py file.

  • pass on function call that non-related to try - except - I ignore these cases.

  • pass on try - except which has good explanation (commented) - I leave them be

  • otherwise, I remove the try-except block. The logic of the code should make sure that we do not need these except. If any test fails, I put back the try-except for the explicit exception and put a comment in place.

Fixed

Assignee

Kimyen Truong

Reporter

Larsson Omberg

Labels

None

Validator

Larsson Omberg

Development Area

None

Release Version History

None

Slack Channel

None

Components

Fix versions

Priority

Minor