Package io.camunda.zeebe.util.error
Class VirtualMachineErrorHandler
java.lang.Object
io.camunda.zeebe.util.error.VirtualMachineErrorHandler
- All Implemented Interfaces:
FatalErrorHandler,Thread.UncaughtExceptionHandler
public final class VirtualMachineErrorHandler
extends Object
implements FatalErrorHandler, Thread.UncaughtExceptionHandler
Handles all Throwables and exits for
VirtualMachineError. It can also be used as a uncaught exception handler, for example as the default uncaught exception handler-
Method Summary
Modifier and TypeMethodDescriptionvoidHandles arbitraryThrowables and completely terminates the JVM if it's an unrecoverable error, i.e.voiduncaughtException(Thread t, Throwable e)
-
Method Details
-
handleError
Handles arbitraryThrowables and completely terminates the JVM if it's an unrecoverable error, i.e. aVirtualMachineError. Use this method whenever catching aThrowable, before carrying on with your regular error handling.Some example of
VirtualMachineErrors includeOutOfMemoryError,StackOverflowErrorandInternalError. We consider these errors unrecoverable because there is no action we can take to resolve them, and it is safer to terminate and let a hypervisor restart Zeebe.- Specified by:
handleErrorin interfaceFatalErrorHandler- Parameters:
e- the throwable
-
uncaughtException
- Specified by:
uncaughtExceptionin interfaceThread.UncaughtExceptionHandler
-