render :nothing => true, :status => :method_not_allowed
end
+ rescue LibXML::XML::Error, ArgumentError => ex
+ raise OSM::APIBadXMLError.new("osm", xml, ex.message)
rescue ActiveRecord::RecordNotFound
render :nothing => true, :status => :not_found
rescue OSM::APIError => ex
# update the entire set of preferences
def update
- p = XML::Parser.string(request.raw_post)
+ do
+ p = XML::Parser.string(request.raw_post)
+ rescue LibXML::XML::Error, ArgumentError => ex
+ raise OSM::APIBadXMLError.new("preferences", xml, ex.message)
+ end
doc = p.parse
prefs = []
doc.find('//osm/node').each do |pt|
return Node.from_xml_node(pt, create)
end
- rescue LibXML::XML::Error => ex
+ rescue LibXML::XML::Error, ArgumentError => ex
raise OSM::APIBadXMLError.new("node", xml, ex.message)
end
end