- Notifications
You must be signed in to change notification settings - Fork5.5k
Fix exception causes in handlers.py#5530
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
kevin-bates commentedJun 16, 2020
Hi@cool-RR - this seems like a useful set of changes that might better assist in troubleshooting efforts - thank you. Would you also be interested in contributing this exercise to |
cool-RR commentedJun 16, 2020
I put jupyter/jupyter_server on my list of repos to look at. |
cool-RR commentedJun 21, 2020
@Zsailer Would you like this change? |
kevin-bates commentedJun 24, 2020
@cool-RR - this seems like a worthwhile endeavor for this repo. Would you mind cranking out the rest of the changes? |
cool-RR commentedJun 24, 2020
I prefer to do it after the initial PR is accepted, so if there are unexpected difficulties, they come up before I've done that work. |
kevin-bates left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM.
cool-RR commentedJun 24, 2020 via email
Awesome, I'll open a PR next week with the rest of the fixes. …On Wed, Jun 24, 2020 at 6:16 PM Kevin Bates ***@***.***> wrote: Merged#5530 <#5530> into master. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#5530 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAN3SSD7CPAOLQ5A6RXNODRYIKC7ANCNFSM4N4GNZOA> . |
I recently went overMatplotlib,Pandas andNumPy, fixing a small mistake in the way that Python 3's exception chaining is used. If you're interested, I can do it here too. I've done it on just one file right now.
The mistake is this: In some parts of the code, an exception is being caught and replaced with a more user-friendly error. In these cases the syntax
raise new_error from old_errorneeds to be used.Python 3's exception chaining means it shows not only the traceback of the current exception, but that of the original exception (and possibly more.) This is regardless of
raise from. The usage ofraise fromtells Python to put a more accurate message between the tracebacks. Instead of this:You'll get this:
The first is inaccurate, because it signifies a bug in the exception-handling code itself, which is a separate situation than wrapping an exception.
Let me know what you think!