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,io.micronaut.http.HttpResponse<?>>
Direct Known Subclasses:
BufferLengthExceededHandler, ContentLengthExceededHandler, DuplicateRouteHandler, HttpStatusHandler, NotAllowedExceptionHandler

public abstract class ErrorResponseProcessorExceptionHandler<T extends Throwable> extends Object implements ExceptionHandler<T,io.micronaut.http.HttpResponse<?>>
An abstract class to handle exceptions via an HTTP Response and the ErrorResponseProcessor API.
Since:
4.6.0
  • Field Details

  • Constructor Details

    • ErrorResponseProcessorExceptionHandler

      protected ErrorResponseProcessorExceptionHandler(ErrorResponseProcessor<?> responseProcessor)
      Constructor.
      Parameters:
      responseProcessor - Error Response Processor
  • Method Details

    • handle

      public io.micronaut.http.HttpResponse<?> handle(io.micronaut.http.HttpRequest request, T exception)
      Description copied from interface: ExceptionHandler
      Handles an exception and returns the result.
      Specified by:
      handle in interface ExceptionHandler<T extends Throwable,io.micronaut.http.HttpResponse<?>>
      Parameters:
      request - The request
      exception - The exception type
      Returns:
      The result
    • createResponse

      @NonNull protected abstract @NonNull io.micronaut.http.MutableHttpResponse<?> createResponse(T exception)