]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_preference_controller.rb
Optimise retrieval of full relations.
[rails.git] / app / controllers / user_preference_controller.rb
index 68ea88eeac5922def89f7e7e947f73c68332e072..59573047acc3591e22621f1fb041b99abe3f95d9 100644 (file)
@@ -52,7 +52,11 @@ class UserPreferenceController < ApplicationController
 
   # update the entire set of preferences
   def update
-    p = XML::Parser.string(request.raw_post)
+    begin
+      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 = []