Class ErrorResponseProcessorExceptionHandler<T extends Throwable>
java.lang.Object
io.micronaut.http.server.exceptions.ErrorResponseProcessorExceptionHandler<T>
- Type Parameters:
T
- The throwable
- All Implemented Interfaces:
ExceptionHandler<T,
HttpResponse<?>>
- Direct Known Subclasses:
BufferLengthExceededHandler
,ContentLengthExceededHandler
,DuplicateRouteHandler
,HttpStatusHandler
,NotAllowedExceptionHandler
public abstract class ErrorResponseProcessorExceptionHandler<T extends Throwable>
extends Object
implements ExceptionHandler<T,HttpResponse<?>>
An abstract class to handle exceptions via an HTTP Response and the
ErrorResponseProcessor
API.- Since:
- 4.6.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ErrorResponseProcessorExceptionHandler
(ErrorResponseProcessor<?> responseProcessor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NonNull MutableHttpResponse<?>
createResponse
(T exception) HttpResponse<?>
handle
(HttpRequest request, T exception) Handles an exception and returns the result.
-
Field Details
-
responseProcessor
-
-
Constructor Details
-
ErrorResponseProcessorExceptionHandler
Constructor.- Parameters:
responseProcessor
- Error Response Processor
-
-
Method Details
-
handle
Description copied from interface:ExceptionHandler
Handles an exception and returns the result.- Specified by:
handle
in interfaceExceptionHandler<T extends Throwable,
HttpResponse<?>> - Parameters:
request
- The requestexception
- The exception type- Returns:
- The result
-
createResponse
-