From 978e68fc74f6cc257348d6984c53099c1841d46c Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Sat, 19 Mar 2022 00:04:40 +0100 Subject: [PATCH] #3265: Print all thrown exception DecoderExceptions that are not a CorruptedFrameException and dont have BadPacketException or OverflowPacketException as cause are not printed. I also removed the ID message in BadPacketException because bad packet does not mean it has a invalid id the protocol version can also be not valid or the packet was not read to the end and more details are in the message of the exception --- .../src/main/java/net/md_5/bungee/netty/HandlerBoss.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 f8d6becd6..334942372 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 @@ -150,7 +150,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter } ); } else if ( cause.getCause() instanceof BadPacketException ) { - ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - bad packet ID, are mods in use!? {1}", new Object[] + ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - bad packet, are mods in use!? {1}", new Object[] { handler, cause.getCause().getMessage() } ); @@ -160,6 +160,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { handler, cause.getCause().getMessage() } ); + } else + { + ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - could not decode packet! {1}", new Object[] + { + handler, cause.getCause() != null ? cause.getCause() : cause + } ); } } else if ( cause instanceof IOException || ( cause instanceof IllegalStateException && handler instanceof InitialHandler ) ) {