类 ResponseStatusExceptionHandler
- java.lang.Object
- org.springframework.web.server.handler.ResponseStatusExceptionHandler
- 所有已实现的接口:
WebExceptionHandler
public class ResponseStatusExceptionHandler extends Object implements WebExceptionHandler
HandleResponseStatusException
by setting the response status.By default exception stack traces are not shown for successfully resolved exceptions. Use
setWarnLogCategory(String)
to enable logging with stack traces.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Sebastien Deleuze
构造器概要
构造器 构造器 说明 ResponseStatusExceptionHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected HttpStatus
determineStatus(Throwable ex)
Determine the HTTP status implied by the given exception.reactor.core.publisher.Mono<Void>
handle(ServerWebExchange exchange, Throwable ex)
Handle the given exception.void
setWarnLogCategory(String loggerName)
Set the log category for warn logging.
构造器详细资料
ResponseStatusExceptionHandler
public ResponseStatusExceptionHandler()
方法详细资料
setWarnLogCategory
public void setWarnLogCategory(String loggerName)
Set the log category for warn logging.Default is no warn logging. Specify this setting to activate warn logging into a specific category.
- 从以下版本开始:
- 5.1
- 另请参阅:
LogFactory.getLog(String)
,Logger.getLogger(String)
handle
public reactor.core.publisher.Mono<Void> handle(ServerWebExchange exchange, Throwable ex)
从接口复制的说明:WebExceptionHandler
Handle the given exception. A completion signal through the return value indicates error handling is complete while an error signal indicates the exception is still not handled.- 指定者:
handle
在接口中WebExceptionHandler
- 参数:
exchange
- the current exchangeex
- the exception to handle- 返回:
Mono<Void>
to indicate when exception handling is complete
determineStatus
@Nullable protected HttpStatus determineStatus(Throwable ex)
Determine the HTTP status implied by the given exception.- 参数:
ex
- the exception to introspect- 返回:
- the associated HTTP status, if any
- 从以下版本开始:
- 5.0.5