From f2bb432567adb207c356c25cc6a3da9027e08154 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sat, 6 Apr 2024 22:32:29 -0400 Subject: [PATCH] Throw ResourceNotFoundException if the hostname is invalid --- .../mc/service/pinger/impl/JavaMinecraftServerPinger.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 9ea74bf..34f0b68 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.ResourceNotFoundException; import me.braydon.mc.model.server.JavaMinecraftServer; import me.braydon.mc.model.token.JavaServerStatusToken; import me.braydon.mc.service.pinger.MinecraftServerPinger; @@ -16,6 +17,7 @@ import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; +import java.net.UnknownHostException; /** * The {@link MinecraftServerPinger} for @@ -33,9 +35,10 @@ public final class JavaMinecraftServerPinger implements MinecraftServerPinger