From b10aa30d9b147548c3d189527fd5a913b6e62d25 Mon Sep 17 00:00:00 2001 From: Myles Date: Thu, 3 Mar 2016 10:24:01 +0000 Subject: [PATCH] Change error correction to use super, should restore default functionality to errors. --- .../ViaVersion/handlers/ViaDecodeHandler.java | 14 ++++---------- .../ViaVersion/handlers/ViaEncodeHandler.java | 12 ++++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java b/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java index ad39cd125..0a2d0f735 100644 --- a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java +++ b/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java @@ -8,7 +8,6 @@ import us.myles.ViaVersion.ConnectionInfo; import us.myles.ViaVersion.transformers.IncomingTransformer; import us.myles.ViaVersion.util.PacketUtil; -import java.nio.channels.ClosedChannelException; import java.util.List; public class ViaDecodeHandler extends ByteToMessageDecoder { @@ -45,15 +44,10 @@ public class ViaDecodeHandler extends ByteToMessageDecoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (!(cause.getCause().getCause() instanceof CancelException) - && !(cause.getCause().getCause() instanceof ClosedChannelException)) { - if (!(cause.getCause() instanceof CancelException) - && !(cause.getCause() instanceof ClosedChannelException)) { - if (!(cause instanceof CancelException) - && !(cause instanceof ClosedChannelException)) { - if (cause instanceof Exception){ - cause.printStackTrace(); - } + if (!(cause.getCause().getCause() instanceof CancelException)) { + if (!(cause.getCause() instanceof CancelException)) { + if (!(cause instanceof CancelException)) { + super.exceptionCaught(ctx, cause); } } } diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java b/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java index 4cc88c572..dac12dc59 100644 --- a/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java +++ b/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java @@ -72,14 +72,10 @@ public class ViaEncodeHandler extends MessageToByteEncoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (!(cause.getCause().getCause() instanceof CancelException) - && !(cause.getCause().getCause() instanceof ClosedChannelException)) { - if (!(cause.getCause() instanceof CancelException) - && !(cause.getCause() instanceof ClosedChannelException)) { - if (!(cause instanceof CancelException) - && !(cause instanceof ClosedChannelException)) { - if (cause instanceof Exception) - cause.printStackTrace(); + if (!(cause.getCause().getCause() instanceof CancelException)) { + if (!(cause.getCause() instanceof CancelException)) { + if (!(cause instanceof CancelException)) { + super.exceptionCaught(ctx, cause); } } }