Improved error message

This commit is contained in:
M66B
2024-02-19 19:25:53 +01:00
parent 30a8ed66be
commit 32c4f41cb2
2 changed files with 17 additions and 0 deletions

View File

@@ -496,6 +496,19 @@ public class ConnectionHelper {
return false;
}
static boolean isAborted(Throwable ex) {
while (ex != null) {
String msg = ex.getMessage();
if (msg != null &&
(msg.contains("Connection reset by peer") ||
msg.contains("Connection closed by peer")))
return true;
ex = ex.getCause();
}
return false;
}
static boolean isMaxConnections(Throwable ex) {
while (ex != null) {
if (isMaxConnections(ex.getMessage()))