- if (entity == null)
- throw new ModuleExc("AbstractModule.getById: No object for id = " + id);
- return entity;
- }
- catch (Throwable e) {
- throw new ModuleFailure(e);
- }
+ try {
+ Entity result = database.selectById(anId);
+
+ if (result == null) {
+ throw new EntityNotFoundExc("AbstractModule.getById: No object for id = " + anId);
+ }
+
+ return result;
+ }
+ catch (DatabaseExc e) {
+ throw new ModuleFailure("Database exception while retrieving entity with id " + anId);
+ }