Skip to content

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

Merged
lovelydinosaur merged 1 commit intoKludex:masterfrom
oTree-org:master
Mar 29, 2021
Merged

Don't use 'raise exc from None' because it suppresses exception causes#1158
lovelydinosaur merged 1 commit intoKludex:masterfrom
oTree-org:master

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
Contributor

@lovelydinosaur lovelydinosaur 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