Package io.activej.common.exception
Interface FatalErrorHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A callback for any fatal (unchecked) exceptions
Also contains various default handlers
-
Method Summary
Modifier and TypeMethodDescriptiondefault FatalErrorHandlerandThen(FatalErrorHandler nextHandler) Combines handlers by chaining the next handler after the current onestatic 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 anyVirtualMachineErrordefault voidCalled when an unchecked exception is caught during execution of some taskvoidCalled when an unchecked exception is caught during execution of some taskstatic 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
-
Method Details
-
handle
Called when an unchecked exception is caught during execution of some task- Parameters:
e- the caught exceptioncontext- the context in which exception was caught in, possiblynull
-
handle
Called when an unchecked exception is caught during execution of some task- Parameters:
e- the caught exception- See Also:
-
andThen
Combines handlers by chaining the next handler after the current one -
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
-