From 1a268a4496dd0ac354dd821ded9c288a024ecc9e Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sat, 6 Apr 2024 22:35:59 -0400 Subject: [PATCH] Proper error handling --- .../pinger/impl/JavaMinecraftServerPinger.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/braydon/mc/service/pinger/impl/JavaMinecraftServerPinger.java b/src/main/java/me/braydon/mc/service/pinger/impl/JavaMinecraftServerPinger.java index 34f0b68..85cdd4c 100644 --- a/src/main/java/me/braydon/mc/service/pinger/impl/JavaMinecraftServerPinger.java +++ b/src/main/java/me/braydon/mc/service/pinger/impl/JavaMinecraftServerPinger.java @@ -6,6 +6,7 @@ import me.braydon.mc.RESTfulMC; import me.braydon.mc.common.DNSUtils; import me.braydon.mc.common.packet.impl.PacketHandshakingInSetProtocol; import me.braydon.mc.common.packet.impl.PacketStatusInStart; +import me.braydon.mc.exception.impl.BadRequestException; import me.braydon.mc.exception.impl.ResourceNotFoundException; import me.braydon.mc.model.server.JavaMinecraftServer; import me.braydon.mc.model.token.JavaServerStatusToken; @@ -14,10 +15,7 @@ import me.braydon.mc.service.pinger.MinecraftServerPinger; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.UnknownHostException; +import java.net.*; /** * The {@link MinecraftServerPinger} for @@ -35,10 +33,11 @@ public final class JavaMinecraftServerPinger implements MinecraftServerPinger