From 5274483fb9a69bdcfd31935db67267c24c3a18f3 Mon Sep 17 00:00:00 2001 From: TechnicJelle <22576047+TechnicJelle@users.noreply.github.com> Date: Thu, 8 Jun 2023 23:00:02 +0200 Subject: [PATCH] Add port-in-use check to plugin --- .../java/de/bluecolored/bluemap/common/plugin/Plugin.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java index 17b35e7c..442f7bc6 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java @@ -55,6 +55,7 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; +import java.net.BindException; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.nio.file.Path; @@ -194,6 +195,9 @@ private void load(@Nullable ResourcePack preloadedResourcePack) throws IOExcepti } catch (UnknownHostException ex) { throw new ConfigurationException("BlueMap failed to resolve the ip in your webserver-config.\n" + "Check if that is correctly configured.", ex); + } catch (BindException ex) { + throw new ConfigurationException("BlueMap failed to bind to the configured address.\n" + + "This usually happens when the configured port (" + webserverConfig.getPort() + ") is already in use by some other program.", ex); } catch (IOException ex) { throw new ConfigurationException("BlueMap failed to initialize the webserver.\n" + "Check your webserver-config if everything is configured correctly.\n" +