From 03c0e99b271183b0b0ada3a2e890c33085901a71 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Wed, 11 Sep 2024 12:42:11 +0200 Subject: [PATCH] Exclude ConnectException from networking setting as well --- .../mixin/base/integration/MixinClientConnection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/integration/MixinClientConnection.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/integration/MixinClientConnection.java index b5187b73..40995b3c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/integration/MixinClientConnection.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/integration/MixinClientConnection.java @@ -28,6 +28,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import java.net.ConnectException; import java.net.SocketException; @Mixin(ClientConnection.class) @@ -36,7 +37,7 @@ public abstract class MixinClientConnection { @Inject(method = "exceptionCaught", at = @At("HEAD")) private void printNetworkingErrors(ChannelHandlerContext context, Throwable ex, CallbackInfo ci) { if (DebugSettings.global().printNetworkingErrorsToLogs.getValue()) { - if (ex instanceof SocketException) { + if (ex instanceof SocketException || ex instanceof ConnectException) { // Thrown when server is not reachable return; }