java.lang.Object
org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
org.bremersee.exception.spring.boot.autoconfigure.reactive.ApiExceptionHandler
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler, org.springframework.web.server.WebExceptionHandler

public class ApiExceptionHandler extends org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
The reactive api exception handler.
Author:
Christian Bremer
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApiExceptionHandler(List<String> apiPaths, org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.WebProperties.Resources resources, org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, RestApiExceptionMapper restApiExceptionMapper)
    Instantiates a new api exception handler.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse>
    getRoutingFunction(org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes)
     
    protected boolean
    isResponsibleExceptionHandler(org.springframework.web.reactive.function.server.ServerRequest request)
    Is this exception handler responsible.
    protected reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse>
    renderErrorResponse(org.springframework.web.reactive.function.server.ServerRequest request)
    Render error response.

    Methods inherited from class org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler

    afterPropertiesSet, getError, getErrorAttributes, handle, isBindingErrorsEnabled, isMessageEnabled, isPathEnabled, isTraceEnabled, logError, renderDefaultErrorView, renderErrorView, setMessageReaders, setMessageWriters, setViewResolvers

    Methods inherited from class java.lang.Object

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

    • ApiExceptionHandler

      public ApiExceptionHandler(List<String> apiPaths, org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.WebProperties.Resources resources, org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, RestApiExceptionMapper restApiExceptionMapper)
      Instantiates a new api exception handler.
      Parameters:
      apiPaths - the api paths
      errorAttributes - the error attributes
      resources - the resources
      applicationContext - the application context
      serverCodecConfigurer - the server codec configurer
      restApiExceptionMapper - the rest api exception mapper
  • Method Details

    • getRoutingFunction

      protected org.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse> getRoutingFunction(org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes)
      Specified by:
      getRoutingFunction in class org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
    • isResponsibleExceptionHandler

      protected boolean isResponsibleExceptionHandler(org.springframework.web.reactive.function.server.ServerRequest request)
      Is this exception handler responsible.
      Parameters:
      request - the request
      Returns:
      true if it is responsible, otherwise false
    • renderErrorResponse

      @NonNull protected reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse> renderErrorResponse(org.springframework.web.reactive.function.server.ServerRequest request)
      Render error response.
      Parameters:
      request - the request
      Returns:
      the server response