Well ! Thanks for having found the answer. I accepted the duplicate since it is exactly what I wanted and it is well explained. Thanks to everybody for your answers :)
Does anyone have advice or some idea on how to make a custom exception handler in Java ?
I mean modifying the standard Java exception handling method for code-uncatched Exceptions
, Errors
and more generically Throwable
.
The PHP way to do this is to define a custom exception handler, but it seems there is no such way in Java.
The goal I would achieve is to insert a custom process in the Java error handling process :
Uncatched Throwable -> handling "outside my code" by the JVM -> my custom process -> resume JVM standard exception handling if wanted
Thanks to all for any idea or suggestion !
Edit after your answers
Is there a way to generify this handler to all threads without declaring explicitly in each thread ? I opened a new question here for this topic.