Interface ErrorAttributes
- All Known Implementing Classes:
DefaultErrorAttributes
public interface ErrorAttributes
Provides access to error attributes which can be logged or presented to the user.
- Since:
- 2.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetError(org.springframework.web.reactive.function.server.ServerRequest request) Return the underlying cause of the error ornullif the error cannot be extracted.getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, ErrorAttributeOptions options) Return aMapof the error attributes.voidstoreErrorInformation(Throwable error, org.springframework.web.server.ServerWebExchange exchange) Store the given error information in the currentServerWebExchange.
-
Method Details
-
getErrorAttributes
default Map<String,Object> getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, ErrorAttributeOptions options) Return aMapof the error attributes. The map can be used as the model of an error page, or returned as aServerResponsebody.- Parameters:
request- the source requestoptions- options for error attribute contents- Returns:
- a map of error attributes
-
getError
Return the underlying cause of the error ornullif the error cannot be extracted.- Parameters:
request- the source ServerRequest- Returns:
- the
Exceptionthat caused the error ornull
-
storeErrorInformation
void storeErrorInformation(Throwable error, org.springframework.web.server.ServerWebExchange exchange) Store the given error information in the currentServerWebExchange.- Parameters:
error- theExceptionthat caused the errorexchange- the source exchange
-