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

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

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

    Modifier and Type
    Method
    Description
    protected @NonNull org.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse>
    getRoutingFunction(@NonNull org.springframework.boot.webflux.error.ErrorAttributes errorAttributes)
     
    protected boolean
    isResponsibleExceptionHandler(org.springframework.web.reactive.function.server.ServerRequest request)
    Is this exception handler responsible.
    protected @NonNull 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.webflux.autoconfigure.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.webflux.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.WebProperties.Resources resources, org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, org.bremersee.exception.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 @NonNull org.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse> getRoutingFunction(@NonNull org.springframework.boot.webflux.error.ErrorAttributes errorAttributes)
      Specified by:
      getRoutingFunction in class org.springframework.boot.webflux.autoconfigure.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

      protected @NonNull 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