-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Don't pass unexpected exception types to error handlers #2983
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
Conversation
|
Like you, I think the current implementation is a bit confusing. But at least we can get the original error in the handler. This is useful for both logging and troubleshooting errors. But your solution doesn't take this into account. |
|
Perhaps Note, though, that the implementation above will forward the original error when the error handler is installed on |
|
I'm sorry to have misunderstood your solution. I think a test case for the handler of |
|
This assertion is actually already present in flask/tests/test_user_error_handler.py Line 43 in 92964b4
|
|
Oh, I see. I only read the codes in your patch. Please forgive me for wasting your precious time! |
|
I mean, now that you mention it, though, I do think it would be a better API if |
|
Yes, I quite agree with you.
|
This comment has been minimized.
This comment has been minimized.
|
While I understand the results of this, it's making the code harder to follow for me. Based on previous discussions in PRs that led to where we are now, it seems that it was intended that 500 and Instead, based on your discussions, I went the other direction and made it consistent. Thanks for discussing and working on this! Closing in favor of #3266 |
Fixes #2778
cc @ThiefMaster
This follows my last proposal in #2778 (comment).