Add exception message for configuration error

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1063867 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2011-01-26 20:50:23 +00:00
parent cc1dcd9a4c
commit 84e66b1d84
1 changed files with 3 additions and 5 deletions

View File

@ -33,7 +33,6 @@ import java.util.Properties;
import java.util.TreeSet;
import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.util.UserException;
import serp.util.Strings;
@ -440,7 +439,7 @@ public class Options extends TypedProperties {
str = "true";
return cons.newInstance(new Object[]{ str });
} catch (Exception e) {
err = new UserException(_loc.get("conf-no-constructor", str, type), e);
err = new ParseException(_loc.get("conf-no-constructor", str, type), e);
}
// special case: the argument value is a subtype name and a new instance
@ -450,13 +449,12 @@ public class Options extends TypedProperties {
subType = Class.forName(str);
} catch (Exception e) {
err = e;
throw new UserException(_loc.get("conf-no-type", str, type), e);
throw new ParseException(_loc.get("conf-no-type", str, type), e);
}
if (!type.isAssignableFrom(subType))
throw err;
try {
return AccessController.doPrivileged(
J2DoPrivHelper.newInstanceAction(subType));
return AccessController.doPrivileged(J2DoPrivHelper.newInstanceAction(subType));
} catch (PrivilegedActionException pae) {
throw pae.getException();
}