From f8ac53ecd286cc4489212c64c40f119ac3b5aebf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 29 Feb 2020 12:58:06 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=90=9B=20Don=E2=80=99t=20force=20disconnec?= =?utf8?q?tion=20on=20protocol=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 6d51c92..e171678 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -1261,7 +1261,10 @@ public class FcpClient implements Closeable { fcpConnection.removeFcpListener(this); } if (fcpException != null) { - setDisconnected(); + // FORGIVE ME: this should be a property of the exception, “close connection after this” + if (!(fcpException instanceof FcpProtocolException)) { + setDisconnected(); + } throw fcpException; } } -- 2.7.4