@ConditionalOnWebApplication(type=SERVLET) @AutoConfigureAfter(value=ErrorsAutoConfiguration.class) @AutoConfigureBefore(value=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration.class) public class ServletErrorsAutoConfiguration extends Object
| Constructor and Description |
|---|
ServletErrorsAutoConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.boot.web.servlet.error.ErrorAttributes |
errorAttributes(WebErrorHandlers webErrorHandlers,
HttpErrorAttributesAdapter httpErrorAttributesAdapter)
Registers a
ErrorAttributes implementation which would replace the default one provided
by the Spring Boot. |
ErrorsControllerAdvice |
errorsControllerAdvice(WebErrorHandlers webErrorHandlers,
HttpErrorAttributesAdapter httpErrorAttributesAdapter)
Registers a
RestControllerAdvice to catch all
exceptions thrown by the web layer. |
@Bean @ConditionalOnBean(value=WebErrorHandlers.class) public ErrorsControllerAdvice errorsControllerAdvice(WebErrorHandlers webErrorHandlers, HttpErrorAttributesAdapter httpErrorAttributesAdapter)
RestControllerAdvice to catch all
exceptions thrown by the web layer. If there was no WebErrorHandlers in the application
context, then the advice would not be registered.webErrorHandlers - The exception handler.httpErrorAttributesAdapter - To adapt our and Spring Boot's error representations.@Bean @ConditionalOnBean(value=WebErrorHandlers.class) public org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes(WebErrorHandlers webErrorHandlers, HttpErrorAttributesAdapter httpErrorAttributesAdapter)
ErrorAttributes implementation which would replace the default one provided
by the Spring Boot. This ErrorAttributes would be used to adapt Spring Boot's error model
to our customized model.webErrorHandlers - To handle exceptions.httpErrorAttributesAdapter - Adapter between HttpError and
ErrorAttributes.ServletErrorAttributes.Copyright © 2019. All rights reserved.