X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7a216c0ce66e0426613415d887937be729cb26d2..7151fa05e4d4f73956d7f9a7ad2db1f5b956a0c0:/app/controllers/node_controller.rb diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 956a8b8d9..1e0deb140 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -56,6 +56,9 @@ class NodeController < ApplicationController else render :nothing => true, :status => :bad_request end + rescue OSM::APIVersionMismatchError => ex + render :text => "Version mismatch: Provided " + ex.provided.to_s + + ", server had: " + ex.latest.to_s, :status => :bad_request rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found end @@ -69,10 +72,8 @@ class NodeController < ApplicationController node.delete_with_history(@user) rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found - rescue OSM::APIAlreadyDeletedError - render :text => "", :status => :gone - rescue OSM::APIPreconditionFailedError - render :text => "", :status => :precondition_failed + rescue OSM::APIError => ex + render ex.render_opts end end