Skip to content

Commit

Permalink
Remove obsolete error handling in XPathContext (#13038)
Browse files Browse the repository at this point in the history
Resolves #13036
  • Loading branch information
straight-shoota authored Feb 2, 2023
1 parent eca47ab commit 632b64d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/xml/xpath_context.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ class XML::XPathContext

def evaluate(search_path : String)
xpath = XML::Error.collect_generic(@errors) { LibXML.xmlXPathEvalExpression(search_path, self) }
unless xpath
{% if flag?(:arm) || flag?(:aarch64) %}
if errors = XML::Error.errors
raise errors.last
end
{% end %}
raise XML::Error.new("Error in '#{search_path}' expression", 0)
end

raise XML::Error.new("Error in '#{search_path}' expression", 0) unless xpath.value
raise XML::Error.new("Error in '#{search_path}' expression", 0) unless xpath

case xpath.value.type
when LibXML::XPathObjectType::STRING
Expand Down

0 comments on commit 632b64d

Please sign in to comment.