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

Better xml parser error handling #74

Open
Neoklosch opened this issue May 22, 2015 · 0 comments
Open

Better xml parser error handling #74

Neoklosch opened this issue May 22, 2015 · 0 comments

Comments

@Neoklosch
Copy link
Contributor

Catch xml parser in the android2csv command.
If I try to convert an malformed xml file i got the following error:

/home/neoklosch/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rexml/parsers/baseparser.rb:340:in `pull_event': Missing end tag for 'p' (got "string") (REXML::ParseException)
Line: 10
Position: 649
Last 80 unconsumed characters:
from /home/neoklosch/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rexml/parsers/baseparser.rb:184:in `pull'
from /home/neoklosch/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rexml/parsers/treeparser.rb:22:in `parse'
from /home/neoklosch/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rexml/document.rb:287:in `build'
from /home/neoklosch/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rexml/document.rb:44:in `initialize'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/xml-simple-1.1.5/lib/xmlsimple.rb:971:in `new'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/xml-simple-1.1.5/lib/xmlsimple.rb:971:in `parse'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/xml-simple-1.1.5/lib/xmlsimple.rb:1013:in `load_xml_file'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/xml-simple-1.1.5/lib/xmlsimple.rb:186:in `xml_in'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/xml-simple-1.1.5/lib/xmlsimple.rb:203:in `xml_in'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/lib/babelish/android2csv.rb:13:in `load_strings'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/lib/babelish/base2csv.rb:31:in `block in convert'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/lib/babelish/base2csv.rb:29:in `each'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/lib/babelish/base2csv.rb:29:in `convert'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/lib/babelish/commandline.rb:165:in `base2csv'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/lib/babelish/commandline.rb:56:in `block (2 levels) in <class:Commandline>'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/gems/babelish-0.4.0/bin/babelish:6:in `<top (required)>'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/bin/babelish:23:in `load'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/bin/babelish:23:in `<main>'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
from /home/neoklosch/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'

A propper error handling would be helpful.

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

No branches or pull requests

2 participants