From 928b05d3e21eb94b2145bfa5db89d420cf2c274c Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 10 Nov 2024 16:49:53 -0500 Subject: [PATCH] add error message about finishConnect() permissions error Error below: java.net.ConnectException: Permission denied: no further information at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source) at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source) at net.runelite.launcher.Launcher.getBootstrap(Launcher.java:489) at net.runelite.launcher.Launcher.postInstall(Launcher.java:929) at net.runelite.launcher.Launcher.main(Launcher.java:265) Caused by: java.net.ConnectException: Permission denied: no further information at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Unknown Source) at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectEvent.handle(Unknown Source) at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(Unknown Source) at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(Unknown Source) at java.base/java.util.ArrayList.forEach(Unknown Source) at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source) Caused by: java.net.SocketException: Permission denied: no further information at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) --- .../java/net/runelite/launcher/FatalErrorDialog.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/net/runelite/launcher/FatalErrorDialog.java b/src/main/java/net/runelite/launcher/FatalErrorDialog.java index 259e118..360463e 100644 --- a/src/main/java/net/runelite/launcher/FatalErrorDialog.java +++ b/src/main/java/net/runelite/launcher/FatalErrorDialog.java @@ -35,6 +35,7 @@ import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import java.io.IOException; +import java.net.ConnectException; import java.net.SocketException; import java.net.UnknownHostException; import java.security.GeneralSecurityException; @@ -224,11 +225,19 @@ public static void showNetErrorWindow(String action, Throwable err) message += " Cannot assign requested address. This error is most commonly caused by \"split tunneling\" support in VPN software." + " If you are using a VPN, try turning \"split tunneling\" off."; } + // connect() returning SOCKET_ERROR: // WSAEACCES error formatted by NET_ThrowNew() else if (err.getMessage().equals("Permission denied: connect")) { message += " Your internet access is blocked. Firewall or antivirus software may have blocked the connection."; } + // finishConnect() waiting for connect() to finish: + // Java_sun_nio_ch_SocketChannelImpl_checkConnect throws the error, either from select() returning WSAEACCES + // or SO_ERROR being WSAEACCES. NET_ThrowNew adds on the "no further information". + else if (err instanceof ConnectException && err.getMessage().equals("Permission denied: no further information")) + { + message += " Your internet access is blocked. Firewall or antivirus software may have blocked the connection."; + } else { message += " Please check your internet connection.";