]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/node_controller.rb
api06: simplify exception handling and add exception handling to the diff
[rails.git] / app / controllers / node_controller.rb
index f1ee8f66b413820f724b963cc0983baa5d5772b4..1e0deb14004bfb5fc6c99f0388c64e92af65a20a 100644 (file)
@@ -72,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