Is there a way to make a global exception-handler in Java. I want to use like this:
"When an exception is thrown somewhere in the WHOLE program, exit."
The handler may not catch exceptions thrown in a try-catch
body.
Martijn
Use Thread.setDefaultUncaughtExceptionHandler. See Rod Hilton's "Global Exception Handling" blog post for an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With