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

Already on GitHub? Sign in to your account

Make parsing errors inspectable #32

Open
grosser opened this Issue Sep 24, 2012 · 1 comment

Comments

Projects
None yet
2 participants

grosser commented Sep 24, 2012

When parsing fails I get something like:

/Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/multi_xml-0.5.1/lib/multi_xml/parsers/nokogiri.rb:16:in `parse': Opening and ending tag mismatch: meta line 4 and head (Faraday::Error::ParsingError)
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/multi_xml-0.5.1/lib/multi_xml.rb:119:in `parse'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/faraday_middleware-0.8.7/lib/faraday_middleware/response/parse_xml.rb:9:in `block in <class:ParseXml>'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/faraday_middleware-0.8.7/lib/faraday_middleware/response_middleware.rb:48:in `call'

which is pretty hard to debug, so how about raising a MultiXml::ParsingError that has .original_exception and .xml so the cause is easy to inspect

Owner

sferik commented Sep 24, 2012

I'd be open to a patch that makes this change.

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