java.lang.Object
org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
es.kukenan.smartfi.microservice.security.gateway.handler.WebFluxErrorHandler
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler, org.springframework.web.server.WebExceptionHandler

@Component @Order(-2) public class WebFluxErrorHandler extends org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
Global error handler configuration.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Empty message error.
    Service utilities for manage jwt token.
    private es.kukenan.smartfi.common.utils.CustomObjectMapper
    Object mapper for data buffer.
    private OtpService
    Service utilities for SCA.
    private OtpUtilities
    Otp utilities.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebFluxErrorHandler(GlobalErrorAttributes globalErrorAttributes, org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer)
    Constructor.
  • 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)
    Get routing function for handle errors.
    private es.kukenan.smartfi.common.api.dtos.error.ErrorSummaryDto
    Handler for handle Kukenan exception in web flux context.
    private es.kukenan.smartfi.common.api.dtos.error.ErrorSummaryDto
    Handler for handler Unexpected Exception in web flux context.
    private reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse>
    renderErrorResponse(org.springframework.web.reactive.function.server.ServerRequest request)
    Render error if a exception is thrown, valid for service exceptions and own exceptions.

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

    afterPropertiesSet, getError, getErrorAttributes, getErrorAttributes, handle, isBindingErrorsEnabled, isMessageEnabled, 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
  • Field Details

    • EMPTY_ERROR

      private static final String EMPTY_ERROR
      Empty message error.
      See Also:
    • objectMapper

      @Autowired private es.kukenan.smartfi.common.utils.CustomObjectMapper objectMapper
      Object mapper for data buffer.
    • otpService

      @Autowired private OtpService otpService
      Service utilities for SCA.
    • otpUtilities

      @Autowired private OtpUtilities otpUtilities
      Otp utilities.
    • jwtTokenUtilities

      @Autowired private JwtTokenUtilities jwtTokenUtilities
      Service utilities for manage jwt token.
  • Constructor Details

    • WebFluxErrorHandler

      public WebFluxErrorHandler(GlobalErrorAttributes globalErrorAttributes, org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer)
      Constructor.
      Parameters:
      globalErrorAttributes - Global error.
      applicationContext - applicationcontext
      serverCodecConfigurer - server configurer.
  • 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)
      Get routing function for handle errors.
      Specified by:
      getRoutingFunction in class org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
      Parameters:
      errorAttributes - error attributes from the error.
      Returns:
      RouteFunction.
    • renderErrorResponse

      private reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse> renderErrorResponse(org.springframework.web.reactive.function.server.ServerRequest request)
      Render error if a exception is thrown, valid for service exceptions and own exceptions.
      Parameters:
      request - Request with
      Returns:
      Mono with custom error response.
    • handlerKukenanException

      private es.kukenan.smartfi.common.api.dtos.error.ErrorSummaryDto handlerKukenanException(Throwable throwable)
      Handler for handle Kukenan exception in web flux context.
      Parameters:
      throwable - thwowable exception.
      Returns:
      Error Summary Dto with data exception.
    • handlerUnexpectedException

      private es.kukenan.smartfi.common.api.dtos.error.ErrorSummaryDto handlerUnexpectedException(Throwable throwable)
      Handler for handler Unexpected Exception in web flux context.
      Parameters:
      throwable - thwowable exception.
      Returns:
      Error Summary dto specific for Unexpected Exception.