-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
No fatal exceptions #4812
Comments
Are you requesting an exception that can not be caught? That seems kind of strange. What about? function quit(msg::String)
println("Quitting.")
println(msg)
quit()
end |
It will be caught, but the default handler quits(). Is that strange? On Thu, Nov 14, 2013 at 1:43 PM, Ivar Nesje notifications@github.comwrote:
|
So user code can not catch your new exception? If nobody catches an exception julia quits as it is now. Do you mean an exception that quits the REPL so that it does not give you a new prompt after showing the error and stacktrace? |
We try to avoid extra features wherever possible. |
I'm not proposing a new feature. I was wondering if all program exit On Thu, Nov 14, 2013 at 4:36 PM, Jeff Bezanson notifications@github.comwrote:
|
@StefanKarpinski @ViralBShah do you think we should add a |
No. This is very uncommon. Almost every exception should be catchable. I do like @ivarne's idea of adding a method to |
I can see an argument that this code should be allowed to cleanup, via the exception handlers, rather than just terminate: julia> try
quit()
finally
println("Bye")
end
$ # where's my "Bye"? But then all except blocks would need to be executed, and it's less clear if that is a good idea. |
It would be nice to give the user a chance to see fatal errors before closing the REPL (I guess this is mainly an issue on Windows). Requested on list: https://groups.google.com/d/msg/julia-users/M5BTZtTUoz0/46wH40n0K0wJ |
closing in favor of #15514 |
In the example of @vtjnash, I think that the exception handlers should execute only if quit() throws an exception. |
Should there be an exception class that prints and error and then quits when thrown?
For example, this code seems to need to throw a fatal exception:
The text was updated successfully, but these errors were encountered: