]> git.openstreetmap.org Git - rails.git/blobdiff - lib/diff_reader.rb
Fixed 'raw' raises by converting them to the appropriate OSM::APIError type. Made...
[rails.git] / lib / diff_reader.rb
index 217e9309d7329d681141fd3a1115a04b693cc6a0..be48f8b4e9caa6548a8a220859e996f56be69c54 100644 (file)
@@ -72,8 +72,8 @@ class DiffReader
   def with_model
     with_element do |model_name|
       model = MODELS[model_name]
-      raise "Unexpected element type #{model_name}, " +
-        "expected node, way, relation." if model.nil?
+      raise OSM::APIBadUserInput.new("Unexpected element type #{model_name}, " +
+                                     "expected node, way or relation.") if model.nil?
       yield model, @reader.expand
       @reader.next
     end
@@ -130,7 +130,7 @@ class DiffReader
 
           # some elements may have placeholders for other elements in the
           # diff, so we must fix these before saving the element.
-          new.fix_placeholders!(ids)
+          new.fix_placeholders!(ids, placeholder_id)
 
           # create element given user
           new.create_with_history(@changeset.user)