]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/node_controller.rb
api06: Move version-checking into the models, raising an exception on mismatch
[rails.git] / app / controllers / node_controller.rb
index 956a8b8d9e10a50532c98863fbfbd38922777f5c..379ee77c9c3f83d44068989c163d70360779f95a 100644 (file)
@@ -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