Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Only print codec netty exceptions
Dieser Commit ist enthalten in:
Ursprung
b9889d2c45
Commit
8d7c7743b8
@ -3,10 +3,11 @@ package us.myles.ViaVersion.bukkit.handlers;
|
|||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.ByteToMessageDecoder;
|
import io.netty.handler.codec.ByteToMessageDecoder;
|
||||||
|
import io.netty.handler.codec.CodecException;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.bukkit.util.NMSUtil;
|
import us.myles.ViaVersion.bukkit.util.NMSUtil;
|
||||||
import us.myles.ViaVersion.exception.CancelDecoderException;
|
|
||||||
import us.myles.ViaVersion.exception.CancelCodecException;
|
import us.myles.ViaVersion.exception.CancelCodecException;
|
||||||
|
import us.myles.ViaVersion.exception.CancelDecoderException;
|
||||||
import us.myles.ViaVersion.util.PipelineUtil;
|
import us.myles.ViaVersion.util.PipelineUtil;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@ -56,7 +57,7 @@ public class BukkitDecodeHandler extends ByteToMessageDecoder {
|
|||||||
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return; // ProtocolLib compat
|
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return; // ProtocolLib compat
|
||||||
|
|
||||||
super.exceptionCaught(ctx, cause);
|
super.exceptionCaught(ctx, cause);
|
||||||
if (!NMSUtil.isDebugPropertySet()) {
|
if (!NMSUtil.isDebugPropertySet() && PipelineUtil.containsCause(cause, CodecException.class)) {
|
||||||
cause.printStackTrace(); // Print if CB doesn't already do it
|
cause.printStackTrace(); // Print if CB doesn't already do it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,12 @@ package us.myles.ViaVersion.bukkit.handlers;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.handler.codec.CodecException;
|
||||||
import io.netty.handler.codec.MessageToByteEncoder;
|
import io.netty.handler.codec.MessageToByteEncoder;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.bukkit.util.NMSUtil;
|
import us.myles.ViaVersion.bukkit.util.NMSUtil;
|
||||||
import us.myles.ViaVersion.exception.CancelEncoderException;
|
|
||||||
import us.myles.ViaVersion.exception.CancelCodecException;
|
import us.myles.ViaVersion.exception.CancelCodecException;
|
||||||
|
import us.myles.ViaVersion.exception.CancelEncoderException;
|
||||||
import us.myles.ViaVersion.handlers.ChannelHandlerContextWrapper;
|
import us.myles.ViaVersion.handlers.ChannelHandlerContextWrapper;
|
||||||
import us.myles.ViaVersion.handlers.ViaHandler;
|
import us.myles.ViaVersion.handlers.ViaHandler;
|
||||||
import us.myles.ViaVersion.util.PipelineUtil;
|
import us.myles.ViaVersion.util.PipelineUtil;
|
||||||
@ -68,7 +69,7 @@ public class BukkitEncodeHandler extends MessageToByteEncoder implements ViaHand
|
|||||||
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return; // ProtocolLib compat
|
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return; // ProtocolLib compat
|
||||||
|
|
||||||
super.exceptionCaught(ctx, cause);
|
super.exceptionCaught(ctx, cause);
|
||||||
if (!NMSUtil.isDebugPropertySet()) {
|
if (!NMSUtil.isDebugPropertySet() && PipelineUtil.containsCause(cause, CodecException.class)) {
|
||||||
cause.printStackTrace(); // Print if CB doesn't already do it
|
cause.printStackTrace(); // Print if CB doesn't already do it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren