Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
kevin-bates merged 1 commit intojupyter:masterfromcool-RR:patch-1
Jun 24, 2020

Conversation

@cool-RR
Copy link
Contributor

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 syntaxraise new_error from old_error needs 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 ofraise from. The usage ofraise from tells Python to put a more accurate message between the tracebacks. Instead of this:

During handling of the above exception, another exception occurred:

You'll get this:

The above exception was the direct cause of the following exception:

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!

@kevin-bates
Copy link
Member

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 tojupyter_server as well? The reason I bring that up is because if you were to make these changes in one of notebook or jupyter_server repos, it would probably be of higher value applied only to the latter (jupyter_server) - since that's more in the long-range plans of the ecosystem. However, if you'd like to apply to both repositories, these changes are more than welcome!

@cool-RR
Copy link
ContributorAuthor

I put jupyter/jupyter_server on my list of repos to look at.

kevin-bates reacted with thumbs up emoji

@cool-RR
Copy link
ContributorAuthor

@Zsailer Would you like this change?

@kevin-bates
Copy link
Member

@cool-RR - this seems like a worthwhile endeavor for this repo. Would you mind cranking out the rest of the changes?

@cool-RR
Copy link
ContributorAuthor

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 reacted with thumbs up emoji

Copy link
Member

@kevin-bateskevin-bates left a comment

Choose a reason for hiding this comment

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

LGTM.

@kevin-bateskevin-bates merged commitdb46c59 intojupyter:masterJun 24, 2020
@cool-RR
Copy link
ContributorAuthor

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> .

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 23, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@kevin-bateskevin-bateskevin-bates approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@cool-RR@kevin-bates

[8]ページ先頭

©2009-2025 Movatter.jp