Package io.activej.common.exception
Class FatalErrorHandlers
java.lang.Object
io.activej.common.exception.FatalErrorHandlers
Utility methods that allow to handle fatal errors using thread-specific handlers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FatalErrorHandlerhalt()A fatal error handler that terminates JVM on anyThrowablestatic FatalErrorHandlerA fatal error handler that terminates JVM on any error that matches a given predicatestatic FatalErrorHandlerA fatal error handler that terminates JVM on anyErrorstatic FatalErrorHandlerA fatal error handler that terminates JVM on anyOutOfMemoryErrorstatic FatalErrorHandlerA fatal error handler that terminates JVM on anyVirtualMachineErrorstatic FatalErrorHandlerignore()A fatal error handler that simply ignores all received errorsstatic FatalErrorHandlerlogging()A fatal error handler that logs all errors to an internalLoggerstatic FatalErrorHandlerloggingTo(PrintStream stream) A fatal error handler that logs all errors to a givenPrintStreamstatic FatalErrorHandlerloggingTo(org.slf4j.Logger logger) A fatal error handler that logs all errors to a givenLoggerstatic FatalErrorHandlerA fatal error handler that logs all errors to a standard error output streamstatic FatalErrorHandlerA fatal error handler that logs all errors to a standard output streamstatic FatalErrorHandlerrethrow()A fatal error handler that rethrows any error it receivesstatic FatalErrorHandlerA fatal error handler that rethrows any error that matches a given predicate
-
Constructor Details
-
FatalErrorHandlers
public FatalErrorHandlers()
-
-
Method Details
-
ignore
A fatal error handler that simply ignores all received errors -
halt
A fatal error handler that terminates JVM on anyThrowable -
haltOnError
A fatal error handler that terminates JVM on anyError -
haltOnVirtualMachineError
A fatal error handler that terminates JVM on anyVirtualMachineError -
haltOnOutOfMemoryError
A fatal error handler that terminates JVM on anyOutOfMemoryError -
haltOn
A fatal error handler that terminates JVM on any error that matches a given predicate- Parameters:
predicate- a predicate that tests a received error
-
rethrow
A fatal error handler that rethrows any error it receives -
rethrowOn
A fatal error handler that rethrows any error that matches a given predicate- Parameters:
predicate- a predicate that tests a received error
-
logging
A fatal error handler that logs all errors to an internalLogger -
loggingTo
A fatal error handler that logs all errors to a givenLogger- Parameters:
logger- a logger to log all the received errors
-
loggingToSystemOut
A fatal error handler that logs all errors to a standard output stream- See Also:
-
loggingToSystemErr
A fatal error handler that logs all errors to a standard error output stream- See Also:
-
loggingTo
A fatal error handler that logs all errors to a givenPrintStream- Parameters:
stream- a print stream to log all the received errors
-