Exclude ConnectException from networking setting as well

This commit is contained in:
FlorianMichael 2024-09-11 12:42:11 +02:00
parent ea00d1cad0
commit 03c0e99b27
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -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;
}