Including the actual exception if an AuditStrategy can't be created

This commit is contained in:
Adam Warski 2012-01-12 20:11:44 +01:00
parent 23891ff11a
commit aa33b57242
1 changed files with 3 additions and 1 deletions

View File

@ -111,7 +111,9 @@ public class AuditConfiguration {
Class<?> auditStrategyClass = Thread.currentThread().getContextClassLoader().loadClass(auditEntCfg.getAuditStrategyName()); Class<?> auditStrategyClass = Thread.currentThread().getContextClassLoader().loadClass(auditEntCfg.getAuditStrategyName());
strategy = (AuditStrategy) auditStrategyClass.newInstance(); strategy = (AuditStrategy) auditStrategyClass.newInstance();
} catch (Exception e) { } catch (Exception e) {
throw new MappingException(String.format("Unable to create AuditStrategy[%s] instance." , auditEntCfg.getAuditStrategyName())); throw new MappingException(
String.format("Unable to create AuditStrategy[%s] instance." , auditEntCfg.getAuditStrategyName()),
e);
} }
if (strategy instanceof ValidityAuditStrategy) { if (strategy instanceof ValidityAuditStrategy) {