]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/way_controller.rb
api06: Move version-checking into the models, raising an exception on mismatch
[rails.git] / app / controllers / way_controller.rb
index 94a10d4242778335bf1043a2c26d71a9b86f37d4..b22d35d0bfdb393f9bd7d5a854d181b1646bf761 100644 (file)
@@ -58,6 +58,9 @@ class WayController < ApplicationController
       end
     rescue OSM::APIPreconditionFailedError
       render :text => "", :status => :precondition_failed
+    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