Removed unused code

This commit is contained in:
RaphiMC 2024-10-29 17:12:10 +01:00
parent dec70529cc
commit fa44f021d2
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -17,7 +17,6 @@
*/ */
package net.raphimc.viaproxy.proxy.util; package net.raphimc.viaproxy.proxy.util;
import com.viaversion.viaversion.exception.InformativeException;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.DecoderException; import io.netty.handler.codec.DecoderException;
import io.netty.handler.codec.EncoderException; import io.netty.handler.codec.EncoderException;
@ -25,22 +24,10 @@ import net.raphimc.viaproxy.ViaProxy;
import net.raphimc.viaproxy.proxy.session.ProxyConnection; import net.raphimc.viaproxy.proxy.session.ProxyConnection;
import net.raphimc.viaproxy.util.logging.Logger; import net.raphimc.viaproxy.util.logging.Logger;
import java.lang.reflect.Field;
import java.nio.channels.ClosedChannelException; import java.nio.channels.ClosedChannelException;
public class ExceptionUtil { public class ExceptionUtil {
private static Field infoField;
static {
try {
infoField = InformativeException.class.getDeclaredField("info");
infoField.setAccessible(true);
} catch (Throwable e) {
e.printStackTrace();
}
}
public static void handleNettyException(ChannelHandlerContext ctx, Throwable cause, ProxyConnection proxyConnection, boolean client2Proxy) { public static void handleNettyException(ChannelHandlerContext ctx, Throwable cause, ProxyConnection proxyConnection, boolean client2Proxy) {
if (!ctx.channel().isOpen()) return; if (!ctx.channel().isOpen()) return;
if (cause instanceof ClosedChannelException) return; if (cause instanceof ClosedChannelException) return;