#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
This commit is contained in:
Outfluencer 2022-03-19 00:04:40 +01:00 committed by GitHub
parent a17d8f8a66
commit 978e68fc74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ) )
{