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
- See Also:
DefaultErrorAttributes
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Throwable
getError(org.springframework.web.reactive.function.server.ServerRequest request)
Return the underlying cause of the error ornull
if the error cannot be extracted.Map<String,Object>
getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, boolean includeStackTrace)
Return aMap
of the error attributes.void
storeErrorInformation(Throwable error, org.springframework.web.server.ServerWebExchange exchange)
Store the given error information in the currentServerWebExchange
.
Method Detail
getErrorAttributes
Map<String,Object> getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, boolean includeStackTrace)
Return aMap
of the error attributes. The map can be used as the model of an error page, or returned as aServerResponse
body.- Parameters:
request
- the source requestincludeStackTrace
- if stack trace elements should be included- Returns:
- a map of error attributes
getError
Throwable getError(org.springframework.web.reactive.function.server.ServerRequest request)
Return the underlying cause of the error ornull
if the error cannot be extracted.- Parameters:
request
- the source ServerRequest- Returns:
- the
Exception
that 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
- theException
that caused the errorexchange
- the source exchange