IsTest should catch errors and wrap them.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1833 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-11-08 21:19:25 +00:00
parent 5d915be096
commit 703d2dbd19

View File

@ -38,6 +38,7 @@ import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
import com.google.refine.expr.EvalError;
import com.google.refine.expr.Evaluable;
import com.google.refine.grel.Control;
import com.google.refine.grel.ControlFunctionRegistry;
@ -51,8 +52,12 @@ abstract class IsTest implements Control {
}
public Object call(Properties bindings, Evaluable[] args) {
Object o = args[0].evaluate(bindings);
Object o;
try {
o = args[0].evaluate(bindings);
} catch (Exception e) {
o = new EvalError(e.toString());
}
return test(o);
}