Empact / roxml

ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML.
http://roxml.rubyforge.org/
MIT License
223 stars 176 forks source link

RequiredElementMissing is a subclass of Exception #48

Closed lgustafson closed 7 years ago

lgustafson commented 12 years ago

The custom exception class RequiredElementMissing is raised when a required xml accessor is missing during parsing. It is currently a subclass of Exception, meaning that you can't use "rescue => e" to rescue an exception. Instead you'd have to directly rescue it or use "rescue Exception => e". My take is that this behavior is too surprising. It might be a good idea to at least document the difference in the rdocs.

Empact commented 12 years ago

I agree it should descend from StandardError or below, e.g. ArgumentError. If you make a pull request I'll happily include and release it.