This commit is contained in:
Jörg Prante 2020-11-13 14:58:16 +01:00
parent 51f2cd1898
commit 3646c377ef
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
group = org.xbib group = org.xbib
name = netty-http name = netty-http
version = 4.1.54.1 version = 4.1.54.2
gradle.wrapper.version = 6.6.1 gradle.wrapper.version = 6.6.1
netty.version = 4.1.54.Final netty.version = 4.1.54.Final

View file

@ -92,9 +92,10 @@ public class HttpPipeliningHandler extends ChannelDuplexHandler {
@Override @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
logger.log(Level.SEVERE, cause.getMessage(), cause); String message = cause.getMessage() == null ? "null" : cause.getMessage();
logger.log(Level.SEVERE, message, cause);
ctx.writeAndFlush(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, ctx.writeAndFlush(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,
HttpResponseStatus.INTERNAL_SERVER_ERROR, HttpResponseStatus.INTERNAL_SERVER_ERROR,
Unpooled.copiedBuffer(cause.getMessage().getBytes(StandardCharsets.UTF_8)))); Unpooled.copiedBuffer(message.getBytes(StandardCharsets.UTF_8))));
} }
} }