Improved error message logged by DelegatorFactoryImpl.getInstance(...) when a delegator can't be created; added a TODO comment to remind that the code should be refactored to throw the exception instead.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759371 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2016-09-06 07:15:21 +00:00
parent 8fdaa37885
commit 4cbedfc518
@@ -26,13 +26,14 @@ public class DelegatorFactoryImpl extends DelegatorFactory {
public static final String module = DelegatorFactoryImpl.class.getName();
// TODO: this method should propagate the GenericEntityException
public Delegator getInstance(String delegatorName) {
if (Debug.infoOn()) Debug.logInfo("Creating new delegator [" + delegatorName + "] (" + Thread.currentThread().getName() + ")", module);
//Debug.logInfo(new Exception(), "Showing stack where new delegator is being created...", module);
try {
return new GenericDelegator(delegatorName);
} catch (GenericEntityException e) {
Debug.logError(e, "Error creating delegator", module);
Debug.logError(e, "Error creating delegator: " + e.getMessage(), module);
return null;
}
}