Skip to content

Commit

Permalink
fix(jruby): clearer exception when failing to resolve xpath func
Browse files Browse the repository at this point in the history
Specifically, on XPath custom function resolution failure.
  • Loading branch information
flavorjones committed Dec 26, 2020
1 parent 5e45691 commit 133d381
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/java/nokogiri/XmlXpathContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ private IRubyObject node_set(ThreadContext context, String expr, IRubyObject han
return tryGetNodeSet(context, expr, fnResolver);
}
catch (TransformerException ex) {
throw XmlSyntaxError.createXMLXPathSyntaxError(context.runtime, expr, ex).toThrowable(); // Nokogiri::XML::XPath::SyntaxError
throw XmlSyntaxError.createXMLXPathSyntaxError(context.runtime,
(expr + ": " + ex.toString()),
ex).toThrowable();
}
}

Expand Down

0 comments on commit 133d381

Please sign in to comment.