Class ApiExceptionHandlerAutoConfiguration


  • @ConditionalOnWebApplication(type=REACTIVE)
    @ConditionalOnBean({org.springframework.boot.web.reactive.error.ErrorAttributes.class,org.springframework.boot.autoconfigure.web.WebProperties.Resources.class,org.springframework.http.codec.ServerCodecConfigurer.class,org.bremersee.exception.RestApiExceptionMapper.class})
    @AutoConfigureAfter(RestApiExceptionMapperAutoConfiguration.class)
    @Configuration
    public class ApiExceptionHandlerAutoConfiguration
    extends Object
    The api exception handler auto configuration.
    Author:
    Christian Bremer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.Resources> resources, 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.
      void init()
      Init.
    • Constructor Detail

      • ApiExceptionHandlerAutoConfiguration

        public ApiExceptionHandlerAutoConfiguration()
    • Method Detail

      • 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.Resources> resources,
                                                       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 attributes
        resources - the resources
        applicationContext - the application context
        serverCodecConfigurer - the server codec configurer
        restApiExceptionMapper - the rest api exception mapper
        Returns:
        the api exception handler bean