diff --git a/src/main/java/com/github/steveice10/packetlib/BuiltinFlags.java b/src/main/java/com/github/steveice10/packetlib/BuiltinFlags.java new file mode 100644 index 00000000..e433e82f --- /dev/null +++ b/src/main/java/com/github/steveice10/packetlib/BuiltinFlags.java @@ -0,0 +1,8 @@ +package com.github.steveice10.packetlib; + +public class BuiltinFlags { + public static final String PRINT_DNS_ERRORS = "print-dns-errors"; + + private BuiltinFlags() { + } +} diff --git a/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java b/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java index a67a19d0..a87288be 100644 --- a/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java +++ b/src/main/java/com/github/steveice10/packetlib/tcp/TcpClientSession.java @@ -1,5 +1,6 @@ package com.github.steveice10.packetlib.tcp; +import com.github.steveice10.packetlib.BuiltinFlags; import com.github.steveice10.packetlib.Client; import com.github.steveice10.packetlib.ProxyInfo; import com.github.steveice10.packetlib.packet.PacketProtocol; @@ -113,6 +114,9 @@ public class TcpClientSession extends TcpSession { port = srv.getPort(); } } catch(TextParseException e) { + if(getFlag(BuiltinFlags.PRINT_DNS_ERRORS, false)) { + e.printStackTrace(); + } } bootstrap.remoteAddress(host, port);