Class ApiExceptionHandlerAutoConfiguration
java.lang.Object
org.bremersee.exception.spring.boot.autoconfigure.reactive.ApiExceptionHandlerAutoConfiguration
@ConditionalOnWebApplication(type=REACTIVE)
@ConditionalOnClass(name={"com.fasterxml.jackson.databind.ObjectMapper","org.bremersee.exception.RestApiExceptionMapper"})
@ConditionalOnBean({org.springframework.boot.web.reactive.error.ErrorAttributes.class,org.springframework.boot.autoconfigure.web.WebProperties.class,org.springframework.http.codec.ServerCodecConfigurer.class})
@AutoConfigureAfter(RestApiExceptionMapperForWebFluxAutoConfiguration.class)
@AutoConfiguration
@EnableConfigurationProperties(RestApiExceptionMapperBootProperties.class)
public class ApiExceptionHandlerAutoConfiguration
extends Object
The api exception handler autoconfiguration.
- Author:
- Christian Bremer
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new api exception handler autoconfiguration. -
Method Summary
Modifier and TypeMethodDescriptionapiExceptionHandler(org.springframework.beans.factory.ObjectProvider<org.springframework.boot.web.reactive.error.ErrorAttributes> errorAttributes, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.autoconfigure.web.WebProperties> webProperties, org.springframework.context.ApplicationContext applicationContext, org.springframework.beans.factory.ObjectProvider<org.springframework.http.codec.ServerCodecConfigurer> serverCodecConfigurer, org.springframework.beans.factory.ObjectProvider<org.bremersee.exception.RestApiExceptionMapper> restApiExceptionMapper) Builds api exception handler bean.voidinit()Init.
-
Constructor Details
-
ApiExceptionHandlerAutoConfiguration
Instantiates a new api exception handler autoconfiguration.- Parameters:
properties- the properties
-
-
Method Details
-
init
@EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) public void init()Init. -
apiExceptionHandler
@Bean @Order(-2) public ApiExceptionHandler apiExceptionHandler(org.springframework.beans.factory.ObjectProvider<org.springframework.boot.web.reactive.error.ErrorAttributes> errorAttributes, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.autoconfigure.web.WebProperties> webProperties, org.springframework.context.ApplicationContext applicationContext, org.springframework.beans.factory.ObjectProvider<org.springframework.http.codec.ServerCodecConfigurer> serverCodecConfigurer, org.springframework.beans.factory.ObjectProvider<org.bremersee.exception.RestApiExceptionMapper> restApiExceptionMapper) Builds api exception handler bean.- Parameters:
errorAttributes- the error attributeswebProperties- the web propertiesapplicationContext- the application contextserverCodecConfigurer- the server codec configurerrestApiExceptionMapper- the rest api exception mapper- Returns:
- the api exception handler bean
-