From ba98a0689bdfd498ffef4197d11bbde759de96d0 Mon Sep 17 00:00:00 2001 From: UnfamiliarLegacy <74633542+UnfamiliarLegacy@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:55:13 +0200 Subject: [PATCH] Print message when failing to connect to Habbo --- .../protocol/interceptor/ConnectionInterceptor.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/G-Earth/src/main/java/gearth/protocol/interceptor/ConnectionInterceptor.java b/G-Earth/src/main/java/gearth/protocol/interceptor/ConnectionInterceptor.java index b986271..994b589 100644 --- a/G-Earth/src/main/java/gearth/protocol/interceptor/ConnectionInterceptor.java +++ b/G-Earth/src/main/java/gearth/protocol/interceptor/ConnectionInterceptor.java @@ -149,7 +149,13 @@ public class ConnectionInterceptor { try { Socket server; if (!useSocks) { - server = new Socket(proxy.getActual_domain(), proxy.getActual_port()); + try { + server = new Socket(proxy.getActual_domain(), proxy.getActual_port()); + } catch (Exception e) { + logger.error("Failed to connect to Habbo server {}:{}", proxy.getActual_domain(), proxy.getActual_port()); + callbacks.onInterceptorError(); + return; + } } else { SocksConfiguration configuration = ProxyProviderFactory.getSocksConfig(); @@ -163,9 +169,8 @@ public class ConnectionInterceptor { callbacks.onInterceptorConnected(client, server, proxy); } catch (Exception e) { - // should only happen when SOCKS configured badly - callbacks.onInterceptorError(); logger.error("Error occurred while intercepting connection", e); + callbacks.onInterceptorError(); } }).start(); } catch (IOException e) {