From e0d25fdd882cca78eabc60e8b03696a34b381639 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 7 Oct 2023 15:53:07 -0500 Subject: [PATCH] Improve logging for failed DB queries --- .../com/seibel/distanthorizons/core/sql/AbstractDhRepo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java index a1175da80..02f6bf19a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/AbstractDhRepo.java @@ -180,7 +180,10 @@ public abstract class AbstractDhRepo { // SQL exceptions generally only happen when something is wrong with // the database or the query and should cause the system to blow up to notify the developer - throw new RuntimeException("Unexpected Query error: ["+e.getMessage()+"], for script: ["+sql+"].", e); + + String message = "Unexpected Query error: ["+e.getMessage()+"], for script: ["+sql+"]."; + LOGGER.error(message); + throw new RuntimeException(message, e); } }