]> git.openstreetmap.org Git - rails.git/blobdiff - lib/osm.rb
api06: Move version-checking into the models, raising an exception on mismatch
[rails.git] / lib / osm.rb
index bd935102658576295b2670ca46a8b28de89e94b4..a8cb103d2f829540bf06f69ae0437f3c3029b11e 100644 (file)
@@ -24,6 +24,15 @@ module OSM
   class APIAlreadyDeletedError < APIError
   end
 
+  # Raised when the provided version is not equal to the latest in the db.
+  class APIVersionMismatchError < APIError
+    def initialize(provided, latest)
+      @provided, @latest = provided, latest
+    end
+
+    attr_reader :provided, :latest
+  end
+
   # Helper methods for going to/from mercator and lat/lng.
   class Mercator
     include Math