Class ErrorExceptionHandler<T extends Throwable>
java.lang.Object
io.micronaut.http.server.exceptions.ErrorExceptionHandler<T>
- Type Parameters:
T- The throwable
- All Implemented Interfaces:
ExceptionHandler<T,HttpResponse<?>>
- Direct Known Subclasses:
ConversionErrorHandler,UnsatisfiedArgumentHandler,UnsatisfiedRouteHandler,URISyntaxHandler
public abstract class ErrorExceptionHandler<T extends Throwable>
extends Object
implements ExceptionHandler<T,HttpResponse<?>>
An abstract class to handle exceptions with an
Error and responding a Bad Request HTTP Response via the ErrorResponseProcessor API.- Since:
- 4.6.0
- Author:
- Sergio del Amo
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedErrorExceptionHandler(ErrorResponseProcessor<?> responseProcessor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionHttpResponse<?>handle(HttpRequest request, T exception) Handles an exception and returns the result.
-
Field Details
-
responseProcessor
-
-
Constructor Details
-
ErrorExceptionHandler
Constructor.- Parameters:
responseProcessor- Error Response Processor
-
-
Method Details
-
handle
Description copied from interface:ExceptionHandlerHandles an exception and returns the result.- Specified by:
handlein interfaceExceptionHandler<T extends Throwable,HttpResponse<?>> - Parameters:
request- The requestexception- The exception type- Returns:
- The result
-
error
-