1. Java Rosa
  2. javarosa
  3. Issues
Issue #2 new

fail gracefully when encountering an unknown function

Yaw Anokwa
created an issue

When loading a form with arbitrary function calls, javarosa dies with an unhandled exception. example where review() is the arbitrary function:

{{{ E/AndroidRuntime( 743): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 743): org.javarosa.xpath.XPathUnhandledException: XPath evaluation: cannot handle function 'review' E/AndroidRuntime( 743): at org.javarosa.xpath.expr.XPathFuncExpr.eval(XPathFuncExpr.java:155) E/AndroidRuntime( 743): at org.javarosa.xpath.XPathConditional.evalRaw(XPathConditional.java:57) E/AndroidRuntime( 743): at org.javarosa.xpath.XPathConditional.eval(XPathConditional.java:61) E/AndroidRuntime( 743): at org.javarosa.core.model.FormDef.evaluateConstraint(FormDef.java:520) }}}

This should be handled gracefully and either logged as a warning/error, or pushed through the UI to the user. Either way, the form should still work.

Comments (0)

  1. Log in to comment