[Minor] Don't double throw StrolchPolicyException if can't get policy

This commit is contained in:
Robert von Burg 2019-10-18 17:26:52 +02:00
parent 19765898d6
commit c2ae2e88d1
1 changed files with 2 additions and 0 deletions

View File

@ -106,6 +106,8 @@ public class DefaultPolicyHandler extends StrolchComponent implements PolicyHand
return constructor.newInstance(getContainer(), tx);
} catch (Exception e) {
if (e instanceof StrolchPolicyException)
throw (StrolchPolicyException) e;
throw new StrolchPolicyException(
MessageFormat.format("Failed to instantiate policy {0} due to {1}", policyDef, e.getMessage()), e);
}