mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-30 13:13:59 +01:00
Removed unused code
This commit is contained in:
parent
dec70529cc
commit
fa44f021d2
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user