Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An inconditional rescue may shadow XML parsing problems #173

Closed
tokland opened this issue Apr 4, 2011 · 2 comments
Closed

An inconditional rescue may shadow XML parsing problems #173

tokland opened this issue Apr 4, 2011 · 2 comments

Comments

@tokland
Copy link

tokland commented Apr 4, 2011

I was working with a faulty SOAP server (it used wrong namespaces) and I was pretty confused because I got an empty hash but no error at all (but there was XML response there!). The problem, in lib/savon/soap/xml.rb:

  # Converts a given SOAP response +xml+ to a Hash.
  def self.parse(xml)
    Crack::XML.parse(xml) rescue {}
  end

I think it's better to remove the rescue and just let the parsing blow so the programmer is aware of the problem and deals with it as he/she sees fit.

@rubiii
Copy link
Contributor

rubiii commented Apr 5, 2011

you're right about raising these exceptions and it's the default behavior of v0.9.0. please read the changelog and update if you can.

@rubiii rubiii closed this as completed Apr 5, 2011
@tokland
Copy link
Author

tokland commented Apr 5, 2011

Thanks for the quick response. I can't update the gem for this project but I am happy to know it will be there in the future :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants