Permalink
Browse files

Add the offending expression to the exception message

  • Loading branch information...
ndw committed Feb 13, 2014
1 parent 00093ec commit bac278c417bb41fa9d99c44f668f7dac0a64fc47
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/com/xmlcalabash/util/ProcessMatch.java
@@ -71,6 +71,7 @@ public ProcessMatch(XProcRuntime runtime, ProcessMatchingNodes processor) {
public void match(XdmNode doc, RuntimeValue match) {
XdmNode node = match.getNode();
+ String expr = match.getString();
try {
XPathEvaluator xeval = new XPathEvaluator(saxonConfig);
@@ -106,7 +107,7 @@ public void match(XdmNode doc, RuntimeValue match) {
if (e.getMessage() != null && e.getMessage().contains("syntax error")) {
throw XProcException.dynamicError(23,node,e,"Syntax error in match pattern: \"" + match.getString() + "\"");
} else {
- throw XProcException.dynamicError(23,node,e,"Expression could not be evaluated");
+ throw XProcException.dynamicError(23,node,e,"Expression could not be evaluated: " + expr);
}
}
}

0 comments on commit bac278c

Please sign in to comment.