From 584a8cabe72d6dd9e4870c2dc2d11b89436249de Mon Sep 17 00:00:00 2001 From: Sergejs Visockis Date: Thu, 28 Mar 2024 21:20:43 +0100 Subject: [PATCH] update an exception message (#79) --- .../main/java/com/iluwatar/activerecord/RecordBase.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/active-record/src/main/java/com/iluwatar/activerecord/RecordBase.java b/active-record/src/main/java/com/iluwatar/activerecord/RecordBase.java index 4fc4862df970..c74b3710d166 100644 --- a/active-record/src/main/java/com/iluwatar/activerecord/RecordBase.java +++ b/active-record/src/main/java/com/iluwatar/activerecord/RecordBase.java @@ -41,7 +41,9 @@ public List findAll(Class clazz) { return recordList; } } catch (SQLException e) { - throw new RuntimeException(e); + throw new RuntimeException( + "Unable to find all the records for the following domain model : " + clazz.getName() + + " due to the data persistence error", e); } } @@ -66,7 +68,10 @@ public T findById(Long id, Class clazz) { return getDeclaredClassInstance(clazz); } } catch (SQLException e) { - throw new RuntimeException(e); + throw new RuntimeException( + "Unable to the record for the following domain model : " + clazz.getName() + " by id=" + + id + + " due to the data persistence error", e); } }