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

Hotfix broken raise statement #2719

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Jul 3, 2020

PR Summary

fix a broken raise statement (missing positional argument in YTFieldNotFound init).
While I'm at it, I'm changing the pattern to EAFP.

edit:
Wait. This error is actually encapsulating another one that's pretty much identical

KeyError: 'No field named blblblb'
During handling of the above exception, another exception occurred:

YTFieldNotFound 
YTFieldNotFound: Could not find field 'blblblb' in MYFILE.

So I think the best course of action is simply to get rid of this redundant error-chaining.

But there's worse: I'm getting this while I'm trying to add a field to a dataset, so none of these errors makes much sense to me.
-> this is a different problem and is actually fixed with #2638

@neutrinoceros neutrinoceros added bug api-consistency naming conventions, code deduplication, informative error messages, code smells... labels Jul 3, 2020
@neutrinoceros neutrinoceros marked this pull request as draft July 3, 2020 07:39
@neutrinoceros neutrinoceros marked this pull request as ready for review July 3, 2020 08:56
@neutrinoceros neutrinoceros changed the title Hotfix broken error Hotfix broken raise statement Jul 5, 2020
@matthewturk
Copy link
Member

So I am trying to recall if there are places we catch YTFieldNotFound as a signal, but I can't find them. So this looks good to me.

@matthewturk matthewturk merged commit b955204 into yt-project:master Jul 23, 2020
@neutrinoceros neutrinoceros deleted the hotfix_broken_error branch July 23, 2020 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-consistency naming conventions, code deduplication, informative error messages, code smells... bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants