Less error for IOExceptions, more debug for exceptions in the exception handler.

This commit is contained in:
md_5 2013-03-14 19:22:54 +11:00
parent c1ff4ffb89
commit d54f2462a8

View File

@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundMessageHandlerAdapter; import io.netty.channel.ChannelInboundMessageHandlerAdapter;
import io.netty.handler.timeout.ReadTimeoutException; import io.netty.handler.timeout.ReadTimeoutException;
import java.io.IOException;
import java.util.logging.Level; import java.util.logging.Level;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.connection.CancelSendSignal; import net.md_5.bungee.connection.CancelSendSignal;
@ -51,7 +52,7 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter<byte[]>
{ {
if ( handler != null && ctx.channel().isActive() ) if ( handler != null && ctx.channel().isActive() )
{ {
DefinedPacket packet = DefinedPacket.packet( msg); DefinedPacket packet = DefinedPacket.packet( msg );
boolean sendPacket = true; boolean sendPacket = true;
if ( packet != null ) if ( packet != null )
{ {
@ -78,13 +79,23 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter<byte[]>
if ( cause instanceof ReadTimeoutException ) if ( cause instanceof ReadTimeoutException )
{ {
ProxyServer.getInstance().getLogger().log( Level.WARNING, handler + " - read timed out" ); 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 } else
{ {
ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - encountered exception", cause ); ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - encountered exception", cause );
} }
if ( handler != null ) if ( handler != null )
{
try
{ {
handler.exception( cause ); handler.exception( cause );
} catch ( Exception ex )
{
ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex );
}
} }
ctx.close(); ctx.close();
} }