@FunctionalInterface public interface ExceptionHandler
The overloads delegate to on(Class, String, Throwable). Implementations must
be non-blocking and re-entrant.
NullExceptionHandler,
Slf4jExceptionHandler| Modifier and Type | Method and Description |
|---|---|
default ExceptionHandler |
defaultHandler()
Retrieves the default underlying exception handler.
|
static ExceptionHandler |
ignoresEverything()
Creates an
ExceptionHandler that ignores all exceptions. |
default boolean |
isEnabled(@NotNull Class<?> aClass)
Checks if the exception handler is enabled for the given class.
|
default void |
on(@NotNull Class<?> clazz,
String message)
Convenience overload delegating to
on(Class, String, Throwable) with a null throwable. |
default void |
on(@NotNull Class<?> clazz,
@Nullable String message,
@Nullable Throwable thrown)
Handles an exception for the given class, message and throwable.
|
default void |
on(@NotNull Class<?> clazz,
Throwable thrown)
Convenience overload delegating to
on(Class, String, Throwable) with an empty message. |
default void |
on(@NotNull org.slf4j.Logger logger,
@Nullable String message)
Convenience overload delegating to
on(Logger, String, Throwable) with a null throwable. |
void |
on(@NotNull org.slf4j.Logger logger,
@Nullable String message,
@Nullable Throwable thrown)
Handles an exception with the given logger, message and throwable.
|
static ExceptionHandler ignoresEverything()
ExceptionHandler that ignores all exceptions.NullExceptionHandler which ignores all exceptions.default void on(@NotNull
@NotNull Class<?> clazz,
Throwable thrown)
on(Class, String, Throwable) with an empty message.clazz - the class where the error occurredthrown - the throwable instance representing the error, may be nullNullPointerException - if clazz is nulldefault void on(@NotNull
@NotNull Class<?> clazz,
String message)
on(Class, String, Throwable) with a null throwable.clazz - the class where the error occurredmessage - a custom message detailing the error, may be nullNullPointerException - if clazz is nulldefault void on(@NotNull
@NotNull Class<?> clazz,
@Nullable
@Nullable String message,
@Nullable
@Nullable Throwable thrown)
Slf4jExceptionHandler.ERROR level.clazz - the class where the exception occurredmessage - a custom message providing additional information or nullthrown - the exception that needs to be handled, may be nullNullPointerException - if clazz is nullvoid on(@NotNull
@NotNull org.slf4j.Logger logger,
@Nullable
@Nullable String message,
@Nullable
@Nullable Throwable thrown)
logger - the logger used to record the errormessage - a custom message detailing the error, may be nullthrown - the throwable instance representing the error, may be nullNullPointerException - if logger is nulldefault void on(@NotNull
@NotNull org.slf4j.Logger logger,
@Nullable
@Nullable String message)
on(Logger, String, Throwable) with a null throwable.logger - the logger used to record the errormessage - a custom message detailing the error, may be nullNullPointerException - if logger is nulldefault boolean isEnabled(@NotNull
@NotNull Class<?> aClass)
aClass - the class to testtrue if this handler should be invoked for the classNullPointerException - if aClass is nulldefault ExceptionHandler defaultHandler()
thisCopyright © 2026 Chronicle Software Ltd. All rights reserved.