提交 4831d38d 编写于 作者: R Rossen Stoyanchev

Lower log level for ResponseStatusException

Issue: SPR-16049
上级 e9187daa
......@@ -87,9 +87,9 @@ public class ResponseStatusException extends NestedRuntimeException {
}
@Override
@Nullable
public String getMessage() {
String msg = "Response status " + this.status + (this.reason != null ? " with reason \"" + reason + "\"" : "");
String msg = "Response status " + this.status +
(this.reason != null ? " with reason \"" + reason + "\"" : "");
return NestedExceptionUtils.buildMessage(msg, getCause());
}
......
......@@ -35,14 +35,13 @@ public class ResponseStatusExceptionHandler implements WebExceptionHandler {
private static final Log logger = LogFactory.getLog(ResponseStatusExceptionHandler.class);
@Override
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
if (ex instanceof ResponseStatusException) {
exchange.getResponse().setStatusCode(((ResponseStatusException) ex).getStatus());
if (ex.getMessage() != null) {
logger.error(ex.getMessage());
}
return Mono.empty();
logger.debug(ex.getMessage());
return exchange.getResponse().setComplete();
}
return Mono.error(ex);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册