From 163c0bf1fac5eb3f17406a6bcc0ed8ba5d5b041f Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 14 Jan 2024 15:52:36 -0600 Subject: [PATCH] Fix another repo closed issue --- .../core/sql/DbConnectionClosedException.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/DbConnectionClosedException.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/DbConnectionClosedException.java index 5f37e4213..75a8b769d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/DbConnectionClosedException.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/DbConnectionClosedException.java @@ -16,6 +16,11 @@ public class DbConnectionClosedException extends SQLException // helper methods // - public static boolean IsClosedException(SQLException e) { return e.getMessage().toLowerCase().contains("connection closed"); } + public static boolean IsClosedException(SQLException e) + { + // TODO long term we should prevent using repos that are closed, but for now this is the easier solution + String message = e.getMessage().toLowerCase(); + return message.contains("connection closed") || message.contains("pointer is closed"); + } }