savonrb / nori

XML to Hash translator
MIT License
247 stars 74 forks source link

Implement error handling in Nokogiri parser #81

Open stenlarsson opened 5 years ago

stenlarsson commented 5 years ago

If a parse error occurred anywhere inside the XML, the Nokogiri parser just returns whatever happens to be on top of the stack. This makes it very hard to troubleshoot the error down the line.

To avoid this we need to implement the error method and raise an error. This introduces a new exception type Nori::ParseError which we also need to raise in the REXML parser to make it symmetric.