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

Make parsing errors inspectable #32

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

Make parsing errors inspectable #32

grosser opened this issue Sep 24, 2012 · 1 comment

Comments

@grosser
Copy link

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

@sferik
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants