-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Prevent prefilter from crashing IPython #415
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
|
Why |
|
Because I managed to commit while I was checking that the test I added failed when the exception wasn't caught. Fixed now. |
|
Looks good to me. I'll test it later. |
|
That's working here. Is it worth catching the specific case (wrong number of arguments for an alias) and displaying a short error message, rather than the full traceback? |
|
If we want IPython to die at every other error, I can only catch the AliasError. I don't actually think that's a good idea, but it would conform with current practices of making IPython crash and exit at the first sign of unrecognized trouble. I think IPython should only crash when something is unrecoverable, not at every possible bug in IPython, but that's something of a separate issue. |
|
I think he's suggesting that you catch the AliasError specifically to make a more focused error message, then catch the rest of the exceptions with the general |
|
As Robert says - I'm not suggesting you remove the general except handler. Just that, in addition, I'd prefer to avoid a traceback of IPython internals for a simple mistake in user code. E.g. for magic functions, if the user's command is wrong in some way, we often just |
instead of full traceback use prefilter_failed flag to prevent duplicate code
|
Okay, now the message is just the short 'ERROR: ' on AliasErrors, but all exceptions are caught. |
|
OK, looks good to me. |
Prevent prefilter from crashing IPython closes gh-216
Prevent prefilter from crashing IPython closes ipythongh-216
Since user code can be executed in the prefilter step (e.g. via Aliases), catch and print those errors like normal code.
I could also be less aggressive and only catch
AliasErrors.Closes #216