Interface ExceptionHandler
-
- All Superinterfaces:
HttpServerComponent
- All Known Implementing Classes:
SimpleExceptionHandler
public interface ExceptionHandler extends HttpServerComponent
Defines a handler to handle exceptions.- Since:
- 2.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Class<ExceptionHandler>componentType()Returns the type of the component.java.util.Optional<java.util.concurrent.CompletionStage<HttpResult>>handle(HttpRequestContext ctx, java.lang.Throwable cause)Handles the exception.-
Methods inherited from interface com.github.fmjsjx.libnetty.http.server.component.HttpServerComponent
close, onServerClosed
-
-
-
-
Method Detail
-
componentType
default java.lang.Class<ExceptionHandler> componentType()
Description copied from interface:HttpServerComponentReturns the type of the component.- Specified by:
componentTypein interfaceHttpServerComponent- Returns:
- the type of the component
-
handle
java.util.Optional<java.util.concurrent.CompletionStage<HttpResult>> handle(HttpRequestContext ctx, java.lang.Throwable cause)
Handles the exception.- Parameters:
ctx- theHttpRequestContextcause- the cause to handle- Returns:
- an
Optional<CompletionStage<HttpResult>>
-
-