From 133d38128829869b4a3dd0245dda6a3caff4ad8e Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 26 Dec 2020 16:31:56 -0500 Subject: [PATCH] fix(jruby): clearer exception when failing to resolve xpath func Specifically, on XPath custom function resolution failure. --- ext/java/nokogiri/XmlXpathContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/java/nokogiri/XmlXpathContext.java b/ext/java/nokogiri/XmlXpathContext.java index 667281871c4..ad74dd44cbf 100644 --- a/ext/java/nokogiri/XmlXpathContext.java +++ b/ext/java/nokogiri/XmlXpathContext.java @@ -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(); } }