Log unresolved exceptions at error level

This commit is contained in:
Sebastien Deleuze 2016-10-03 10:58:24 +02:00
parent 11aa920785
commit 324c310cbd
6 changed files with 7 additions and 9 deletions

View File

@ -54,7 +54,7 @@ public class ReactorHttpHandlerAdapter implements Function<HttpChannel, Mono<Voi
return this.delegate.handle(adaptedRequest, adaptedResponse)
.otherwise(ex -> {
logger.debug("Could not complete request", ex);
logger.error("Could not complete request", ex);
channel.status(HttpResponseStatus.INTERNAL_SERVER_ERROR);
return Mono.empty();
})

View File

@ -58,7 +58,7 @@ public class RxNettyHttpHandlerAdapter implements RequestHandler<ByteBuf, ByteBu
Publisher<Void> result = this.delegate.handle(adaptedRequest, adaptedResponse)
.otherwise(ex -> {
logger.debug("Could not complete request", ex);
logger.error("Could not complete request", ex);
response.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
return Mono.empty();
})

View File

@ -114,7 +114,7 @@ public class ServletHttpHandlerAdapter extends HttpServlet {
@Override
public void onError(Throwable ex) {
logger.debug("Could not complete request", ex);
logger.error("Could not complete request", ex);
HttpServletResponse response = (HttpServletResponse) this.asyncContext.getResponse();
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
this.asyncContext.complete();

View File

@ -72,7 +72,7 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
}
@Override
public void onError(Throwable ex) {
logger.debug("Could not complete request", ex);
logger.error("Could not complete request", ex);
if (!exchange.isResponseStarted() && exchange.getStatusCode() <= 500) {
exchange.setStatusCode(500);
}

View File

@ -123,10 +123,8 @@ public class WebHttpHandlerBuilder {
WebFilter[] array = new WebFilter[this.filters.size()];
webHandler = new FilteringWebHandler(webHandler, this.filters.toArray(array));
}
if (!this.exceptionHandlers.isEmpty()) {
WebExceptionHandler[] array = new WebExceptionHandler[this.exceptionHandlers.size()];
webHandler = new ExceptionHandlingWebHandler(webHandler, this.exceptionHandlers.toArray(array));
}
WebExceptionHandler[] array = new WebExceptionHandler[this.exceptionHandlers.size()];
webHandler = new ExceptionHandlingWebHandler(webHandler, this.exceptionHandlers.toArray(array));
HttpWebHandlerAdapter httpHandler = new HttpWebHandlerAdapter(webHandler);
if (this.sessionManager != null) {
httpHandler.setSessionManager(this.sessionManager);

View File

@ -128,7 +128,7 @@ public class ExceptionHandlingWebHandler extends WebHandlerDecorator {
}
}
else {
logger.debug("Could not complete request", ex);
logger.error("Could not complete request", ex);
}
}