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

add a post_exception hook #10063

Closed
sprig opened this issue Nov 23, 2016 · 2 comments
Closed

add a post_exception hook #10063

sprig opened this issue Nov 23, 2016 · 2 comments
Milestone

Comments

@sprig
Copy link

sprig commented Nov 23, 2016

Hello,

It could be useful to have a 'post_exception' hook, which would run if there is an unhandled exception (basically in cases where now I would see a traceback).

Example use cases:

Would allow for automatic variable injection in sage for undefined variables (by wrapping NameError) this is the actual current motivation.
Would allow automatically restarting/reporting when exceptions are raised from long-running code.
Would a PR implementing this be accepted (assuming it works well, etc)?

Not sure where this is related to #54

@minrk
Copy link
Member

minrk commented Nov 25, 2016

There is already ip.set_custom_exc, which can register custom exception handlers, which are called when an error is raised. Is that sufficient for what you are after?

@sprig
Copy link
Author

sprig commented Nov 26, 2016

@minrk Thanks! It is. Don't know how I missed it...

@sprig sprig closed this as completed Nov 26, 2016
@Carreau Carreau added this to the no action milestone Jan 29, 2017
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

No branches or pull requests

3 participants