public class ThreadLocalisedExceptionHandler extends Object implements ExceptionHandler
Constructor and Description |
---|
ThreadLocalisedExceptionHandler(ExceptionHandler handler) |
Modifier and Type | Method and Description |
---|---|
ExceptionHandler |
defaultHandler() |
ThreadLocalisedExceptionHandler |
defaultHandler(ExceptionHandler defaultHandler) |
boolean |
isEnabled(@NotNull Class<?> aClass) |
void |
on(@NotNull Class<?> clazz,
@Nullable String message,
@Nullable Throwable thrown)
A method to call when an exception occurs.
|
void |
on(@NotNull org.slf4j.Logger logger,
@Nullable String message,
Throwable thrown) |
void |
resetThreadLocalHandler() |
ExceptionHandler |
threadLocalHandler() |
ThreadLocalisedExceptionHandler |
threadLocalHandler(ExceptionHandler handler) |
static ExceptionHandler |
unwrap(ExceptionHandler eh) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
on, on, on
public ThreadLocalisedExceptionHandler(ExceptionHandler handler)
public void on(@NotNull @NotNull Class<?> clazz, @Nullable @Nullable String message, @Nullable @Nullable Throwable thrown)
ExceptionHandler
on
in interface ExceptionHandler
clazz
- the error is associated with, e.g. the one in which it was caught (non-null)message
- any message associated with the error, or an empty Stringthrown
- any Throwable caught, or null if there was no exception.public void on(@NotNull @NotNull org.slf4j.Logger logger, @Nullable @Nullable String message, Throwable thrown)
on
in interface ExceptionHandler
public ExceptionHandler defaultHandler()
public static ExceptionHandler unwrap(ExceptionHandler eh)
public ThreadLocalisedExceptionHandler defaultHandler(ExceptionHandler defaultHandler)
public ExceptionHandler threadLocalHandler()
public ThreadLocalisedExceptionHandler threadLocalHandler(ExceptionHandler handler)
public void resetThreadLocalHandler()
public boolean isEnabled(@NotNull @NotNull Class<?> aClass)
isEnabled
in interface ExceptionHandler
Copyright © 2023. All rights reserved.