From d54f2462a8170f9563aba7e57b227626338d04ad Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 14 Mar 2013 19:22:54 +1100 Subject: [PATCH] Less error for IOExceptions, more debug for exceptions in the exception handler. --- .../java/net/md_5/bungee/netty/HandlerBoss.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index 1f59ba6ae..8d8b114f2 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundMessageHandlerAdapter; import io.netty.handler.timeout.ReadTimeoutException; +import java.io.IOException; import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; @@ -51,7 +52,7 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter { if ( handler != null && ctx.channel().isActive() ) { - DefinedPacket packet = DefinedPacket.packet( msg); + DefinedPacket packet = DefinedPacket.packet( msg ); boolean sendPacket = true; if ( packet != null ) { @@ -78,13 +79,23 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter if ( cause instanceof ReadTimeoutException ) { ProxyServer.getInstance().getLogger().log( Level.WARNING, handler + " - read timed out" ); + } + if ( cause instanceof IOException ) + { + ProxyServer.getInstance().getLogger().log( Level.WARNING, handler + " - IOException: " + cause.getMessage() ); } else { ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - encountered exception", cause ); } if ( handler != null ) { - handler.exception( cause ); + try + { + handler.exception( cause ); + } catch ( Exception ex ) + { + ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); + } } ctx.close(); }