Interface ChannelExceptionHandler<C extends EngineConnection>
- Type Parameters:
- C- The connection type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Channels. This handler
 can be implemented by plugin developers.- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionvoidhandle(C connection, Channel channel, ChannelException exception, @Nullable CompletableFuture<?> future) Handles aChannelExceptionthat occurred for a specificEngineConnection.Gets theChannelExceptionHandlerthat will always log when aChannelExceptionoccurs.default ChannelExceptionHandler<C>suppress(Class<? extends ChannelException> exceptionType) Returns a newChannelExceptionHandlerthat suppresses a certain type ofChannelExceptionto be handled through this exception handler.default ChannelExceptionHandler<C>Returns a newChannelExceptionHandlerthat suppresses everyChannelExceptionto be handled through this exception handler if aCompletableFutureis applicable.default ChannelExceptionHandler<C>suppressIfFutureIsPresent(Class<? extends ChannelException> exceptionType) Returns a newChannelExceptionHandlerthat suppressesChannelExceptionof the given type to be handled through this exception handler if aCompletableFutureis applicable.
- 
Method Details- 
logEverythingGets theChannelExceptionHandlerthat will always log when aChannelExceptionoccurs.CompletableFutures will also receive theChannelExceptions like expected.This ChannelExceptionHandleris useful if you don't need special handling for exceptions. This handler can be customized through the suppress methods.- Returns:
- The channel exception handler
 
- 
handlevoid handle(C connection, Channel channel, ChannelException exception, @Nullable CompletableFuture<?> future) Handles aChannelExceptionthat occurred for a specificEngineConnection. This includes exceptions caused by encoding or decoding payloads, handling packets, when a packet is send to an unsupported connection, etc.The CompletableFutureis the one that was returned by one of the send operations, this one must be completed when an exception occurs. The future is always null when a request packet is being handled on the other side.- Parameters:
- connection- The connection that the exception occurred for
- channel- The channel the exception occurred on
- exception- The exception the occurred
- future- The future of the send operation or receive operation
 
- 
suppressAllIfFutureIsPresentReturns a newChannelExceptionHandlerthat suppresses everyChannelExceptionto be handled through this exception handler if aCompletableFutureis applicable.This ChannelExceptionHandleris useful if you're planning to handle every exception of the returnedCompletableFutures.- Returns:
- The new channel exception handler
 
- 
suppressIfFutureIsPresentdefault ChannelExceptionHandler<C> suppressIfFutureIsPresent(Class<? extends ChannelException> exceptionType) Returns a newChannelExceptionHandlerthat suppressesChannelExceptionof the given type to be handled through this exception handler if aCompletableFutureis applicable.The returned ChannelExceptionHandleris useful if you're planning to handle certain exception types of the returnedCompletableFutures.- Parameters:
- exceptionType- The exception type to suppress
- Returns:
- The new channel exception handler
 
- 
suppressReturns a newChannelExceptionHandlerthat suppresses a certain type ofChannelExceptionto be handled through this exception handler. TheCompletableFutures will still receive the exception.This is useful to suppress certain exceptions from being logged. For example ChannelNotSupportedExceptioncan be suppressed if you don't want to log the exception every time you send a payload to a connection that doesn't support the channel. Then you can handle this through theCompletableFutures.- Parameters:
- exceptionType- The exception type to suppress
- Returns:
- The new channel exception handler
 
 
-