From: David ‘Bombe’ Roden Date: Sat, 29 Feb 2020 11:58:06 +0000 (+0100) Subject: 🐛 Don’t force disconnection on protocol errors X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f8ac53ecd286cc4489212c64c40f119ac3b5aebf;p=jFCPlib.git 🐛 Don’t force disconnection on protocol errors --- 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; } }