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

Don't use 'raise exc from None' because it suppresses exception causes #1158

Merged
merged 1 commit into from
Mar 29, 2021
Merged

Don't use 'raise exc from None' because it suppresses exception causes #1158

merged 1 commit into from
Mar 29, 2021

Conversation

oTree-org
Copy link
Contributor

Fixes #1114

I think raise exc from None is better for targeted cases (like catching KeyError to re-raise a more suitable exception). For catch-all clauses like except Exception we are potentially throwing out useful info about the cause.

Copy link
Member

@tomchristie tomchristie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these cases look more correct to me without the "from None" yup.

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.

"raise exc from None" interferes with exception chaining
2 participants