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

Handle uncaught JVMExceptions in withJVM #180

Open
facundominguez opened this issue Feb 26, 2021 · 0 comments
Open

Handle uncaught JVMExceptions in withJVM #180

facundominguez opened this issue Feb 26, 2021 · 0 comments

Comments

@facundominguez
Copy link
Member

facundominguez commented Feb 26, 2021

Currently, a Haskell program that reports uncaught exceptions in stderr looks like this:

main :: IO ()
main = withJVM [] $ handle (showException >=> Text.hPutStrLn stderr) the_program

The call to handle is cheap enough that it should be made inside of withJVM, making the default behavior the more chatty. Thus, the same behavior could be achieved with

main :: IO ()
main = withJVM [] the_program

If the programmer doesn't want to print uncaught exceptions, she can catch them before the_program returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant