Class WebFluxErrorHandler
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
FieldsModifier and TypeFieldDescriptionprivate static final StringEmpty message error.private JwtTokenUtilitiesService utilities for manage jwt token.private es.kukenan.smartfi.common.utils.CustomObjectMapperObject mapper for data buffer.private OtpServiceService utilities for SCA.private OtpUtilitiesOtp utilities. -
Constructor Summary
ConstructorsConstructorDescriptionWebFluxErrorHandler(GlobalErrorAttributes globalErrorAttributes, org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.ErrorSummaryDtohandlerKukenanException(Throwable throwable) Handler for handle Kukenan exception in web flux context.private es.kukenan.smartfi.common.api.dtos.error.ErrorSummaryDtohandlerUnexpectedException(Throwable throwable) 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
-
Field Details
-
EMPTY_ERROR
Empty message error.- See Also:
-
objectMapper
@Autowired private es.kukenan.smartfi.common.utils.CustomObjectMapper objectMapperObject mapper for data buffer. -
otpService
Service utilities for SCA. -
otpUtilities
Otp utilities. -
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- applicationcontextserverCodecConfigurer- 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:
getRoutingFunctionin classorg.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.
-