X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7a216c0ce66e0426613415d887937be729cb26d2..87494900df0f40c734286139678d347af9c234b7:/app/controllers/node_controller.rb diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 956a8b8d9..4a7527734 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 @@ -67,12 +70,12 @@ class NodeController < ApplicationController begin node = Node.find(params[:id]) node.delete_with_history(@user) + + render :nothing => true 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