]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
be a bit more specific when a way is a member of a relation. Actually return an error...
[rails.git] / app / models / relation.rb
index 09143294ceb48fab466f9780a5f34fb7706d6daf..787c167197abf5add81f61df51c631f42047bbfe 100644 (file)
@@ -288,7 +288,6 @@ class Relation < ActiveRecord::Base
     elements = { :node => Hash.new, :way => Hash.new, :relation => Hash.new }
     self.members.each do |m|
       # find the hash for the element type or die
-      logger.debug m[0]
       hash = elements[m[0].downcase.to_sym] or return false
       # unless its in the cache already
       unless hash.key? m[1]
@@ -299,6 +298,7 @@ class Relation < ActiveRecord::Base
 
         # and check that it is OK to use.
         unless element and element.visible? and element.preconditions_ok?
+          raise OSM::APIPreconditionFailedError.new("Relation with id #{self.id} cannot be saved due to #{m[0]} with id #{element.id}")
           return false
         end
         hash[m[1]] = true