throw EvaluatorException instead of RuntimeException to prevent Rhino exception wrapping,

change to new DatabaseObject constructor signature.
This commit is contained in:
hns 2003-10-23 11:44:13 +00:00
parent 010fef5ee4
commit 0f5abe0028

View file

@ -190,11 +190,11 @@ public class GlobalObject extends ScriptableObject {
*/ */
public Object getDBConnection(String dbsource) throws Exception { public Object getDBConnection(String dbsource) throws Exception {
if (dbsource == null) if (dbsource == null)
throw new RuntimeException ("Wrong number of arguments in getDBConnection(dbsource)"); throw new EvaluatorException("Wrong number of arguments in getDBConnection(dbsource)");
DbSource dbsrc = app.getDbSource (dbsource.toLowerCase ()); DbSource dbsrc = app.getDbSource (dbsource.toLowerCase ());
if (dbsrc == null) if (dbsrc == null)
throw new RuntimeException ("DbSource "+dbsource+" does not exist"); throw new EvaluatorException("DbSource "+dbsource+" does not exist");
DatabaseObject db = new DatabaseObject (dbsrc, 0); DatabaseObject db = new DatabaseObject (dbsrc);
return Context.toObject(db, this); return Context.toObject(db, this);
} }