Lower log level for ResponseStatusException
Issue: SPR-16049
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user