接口 ErrorAttributes
- 所有已知实现类:
DefaultErrorAttributes
public interface ErrorAttributes
Provides access to error attributes which can be logged or presented to the user.- 从以下版本开始:
- 2.0
- 另请参阅:
DefaultErrorAttributes
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 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
.
方法详细资料
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.- 参数:
request
- the source requestincludeStackTrace
- if stack trace elements should be included- 返回:
- 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.- 参数:
request
- the source ServerRequest- 返回:
- 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
.- 参数:
error
- theException
that caused the errorexchange
- the source exchange