Package org.bremersee.web.reactive
Class ApiExceptionHandler
- java.lang.Object
-
- org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
-
- org.bremersee.web.reactive.ApiExceptionHandler
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler
,org.springframework.web.server.WebExceptionHandler
@Validated 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(@NotNull org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.WebProperties.Resources resources, @NotNull org.springframework.context.ApplicationContext applicationContext, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, @NotNull org.bremersee.exception.RestApiExceptionMapper restApiExceptionMapper)
Instantiates a new api exception handler.
-
Method Summary
All Methods Instance Methods Concrete Methods 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, getErrorAttributes, handle, isBindingErrorsEnabled, isMessageEnabled, isTraceEnabled, logError, renderDefaultErrorView, renderErrorView, setMessageReaders, setMessageWriters, setViewResolvers
-
-
-
-
Constructor Detail
-
ApiExceptionHandler
public ApiExceptionHandler(@NotNull @NotNull org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes, @NotNull org.springframework.boot.autoconfigure.web.WebProperties.Resources resources, @NotNull @NotNull org.springframework.context.ApplicationContext applicationContext, @Nullable org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, @NotNull @NotNull org.bremersee.exception.RestApiExceptionMapper restApiExceptionMapper)
Instantiates a new api exception handler.- Parameters:
errorAttributes
- the error attributesresources
- the resourcesapplicationContext
- the application contextserverCodecConfigurer
- the server codec configurerrestApiExceptionMapper
- the rest api exception mapper
-
-
Method Detail
-
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 classorg.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, otherwisefalse
-
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
-
-