Interface ListenerExceptionHandler<K,E,O>
- Type Parameters:
K
- the key typeE
- the event typeO
- the order type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface to handle the exception that is thrown from
SubscribedListener.consumer()
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The operations that indicates what theEventCaller
should do next -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
E, O> @NotNull ListenerExceptionHandler<K, E, O> Creates aListenerExceptionHandler
that returnsListenerExceptionHandler.Result.CONTINUE
.@NotNull ListenerExceptionHandler.Result
handleException
(E event, @NotNull SubscribedListener<K, ? extends E, O> listener, @NotNull Throwable exception) Handles the exception.
-
Method Details
-
continueHandler
Creates aListenerExceptionHandler
that returnsListenerExceptionHandler.Result.CONTINUE
.- Type Parameters:
K
- the key typeE
- the event typeO
- the order type- Returns:
- a
ListenerExceptionHandler
that returnsListenerExceptionHandler.Result.CONTINUE
-
handleException
@NotNull @NotNull ListenerExceptionHandler.Result handleException(@NotNull E event, @NotNull @NotNull SubscribedListener<K, ? extends E, O> listener, @NotNull @NotNull Throwable exception) Handles the exception.- Parameters:
event
- the event instancelistener
- theSubscribedListener
that throws an exceptionexception
- the thrown exception- Returns:
- the
ListenerExceptionHandler.Result
that indicates what theEventCaller
should do next
-