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); } }