]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
capture the too many way nodes error, and give the user an error message
[rails.git] / app / controllers / amf_controller.rb
index d040a51bba304d58aaa3f5702457fbef9f05a508..7061805574c427e0dff278fc20338c2b6b02549d 100644 (file)
@@ -588,6 +588,8 @@ class AmfController < ApplicationController
     # last version was in the same changeset, or belongs to the same user, then
     # we can return something different
     return [-3, "You have taken too long to edit, please reload the area"]
     # last version was in the same changeset, or belongs to the same user, then
     # we can return something different
     return [-3, "You have taken too long to edit, please reload the area"]
+  rescue OSM::APITooManyWayNodesError => ex
+    return [-1, "You have tried to upload a way with #{ex.provided}, however only #{ex.max} are allowed."]
   rescue OSM::APIAlreadyDeletedError => ex
     return [-1, "The object has already been deleted"]
   rescue OSM::APIError => ex
   rescue OSM::APIAlreadyDeletedError => ex
     return [-1, "The object has already been deleted"]
   rescue OSM::APIError => ex