Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(functions.py): changed error catching checks to be for dictionari… #74

Merged
merged 1 commit into from
May 9, 2024

Conversation

MWSammons
Copy link
Contributor

…es with error keys in them as opposed to strings

…es with error keys in them as opposed to strings
@MWSammons MWSammons requested a review from tjzegmott May 9, 2024 17:42
@MWSammons MWSammons linked an issue May 9, 2024 that may be closed by this pull request
@tjzegmott
Copy link
Contributor

Could you copy/paste an example of the difference in output pre-/post- changes?

@MWSammons
Copy link
Contributor Author

sure @tjzegmott , original behaviour goes like this

In [12]: x = funcs.get_dataset_file_info('chime.event.intensity.raw', '60011290')

In [13]: print(x)
{'error': 'Could not find 60011290 chime.event.intensity.raw in Datatrail.'}

In [14]: if isinstance(x, str):
    ...:     print('error')
    ...: else:
    ...:     print('uncaught')
    ...: 
uncaught

New behaviour goes like this

In [15]: x = funcs.get_dataset_file_info('chime.event.intensity.raw', '60011290')

In [16]: print(x)
{'error': 'Could not find 60011290 chime.event.intensity.raw in Datatrail.'}

In [17]: if "error" in x:
    ...:     print('error')
    ...: else:
    ...:     print('uncaught')
    ...: 
error

@MWSammons
Copy link
Contributor Author

A more explicit error message of the original behaviour can be found : #73

@tjzegmott tjzegmott merged commit 6fdb244 into main May 9, 2024
2 checks passed
@tjzegmott tjzegmott deleted the 73-bug-uncaught-exception-in-pull-command branch May 9, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Uncaught exception in pull command
2 participants