Class ApiExceptionHandler
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
ConstructorsConstructorDescriptionApiExceptionHandler(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, org.bremersee.exception.RestApiExceptionMapper restApiExceptionMapper) Instantiates a new api exception handler. -
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) protected booleanisResponsibleExceptionHandler(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
-
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, org.bremersee.exception.RestApiExceptionMapper restApiExceptionMapper) Instantiates a new api exception handler.- Parameters:
apiPaths- the api pathserrorAttributes- the error attributesresources- the resourcesapplicationContext- the application contextserverCodecConfigurer- the server codec configurerrestApiExceptionMapper- 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:
getRoutingFunctionin 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:
trueif 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
-