Make the role in relations optional, with a test to make sure it is. Also start moving the errors reading the xml to exceptions, thus making it possible to give meaningful error messages, when bad xml is sent (More work is required on this including doing the same for nodes and ways). With the latest gems update it seems that the lib xml handling was broken, using the newer method. Adding the content type for the exceptions.

This commit is contained in:
Shaun McDonald 2008-11-24 18:55:24 +00:00
parent 152cb13a02
commit 0ff1214f86
6 changed files with 106 additions and 27 deletions

View file

@ -1,5 +1,9 @@
# This is required otherwise libxml writes out memory errors to
# the standard output and exits uncleanly
LibXML::XML::Parser.register_error_handler do |message|
# Changed method due to deprecation of the old register_error_handler
# http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/Parser.html#M000076
# So set_handler is used instead
# http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/Error.html#M000334
LibXML::XML::Error.set_handler do |message|
raise message
end