Class HttpStatusHandler

  • All Implemented Interfaces:
    ExceptionHandler<io.micronaut.http.exceptions.HttpStatusException,​io.micronaut.http.HttpResponse>

    @Singleton
    @Produces
    public class HttpStatusHandler
    extends java.lang.Object
    implements ExceptionHandler<io.micronaut.http.exceptions.HttpStatusException,​io.micronaut.http.HttpResponse>
    Handles exception of type HttpStatusException.
    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.micronaut.http.HttpResponse handle​(io.micronaut.http.HttpRequest request, io.micronaut.http.exceptions.HttpStatusException exception)
      Handles an exception and returns the result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpStatusHandler

        @Inject
        public HttpStatusHandler​(ErrorResponseProcessor<?> responseProcessor)
        Constructor.
        Parameters:
        responseProcessor - Error Response Processor
    • Method Detail

      • handle

        public io.micronaut.http.HttpResponse handle​(io.micronaut.http.HttpRequest request,
                                                     io.micronaut.http.exceptions.HttpStatusException exception)
        Description copied from interface: ExceptionHandler
        Handles an exception and returns the result.
        Specified by:
        handle in interface ExceptionHandler<io.micronaut.http.exceptions.HttpStatusException,​io.micronaut.http.HttpResponse>
        Parameters:
        request - The request
        exception - The exception type
        Returns:
        The result