Give a nice error message when parsing the nwr tags and they are missing the k and/or v. Also includes tests.
This commit is contained in:
parent
b7d004e817
commit
65eb6af303
6 changed files with 96 additions and 2 deletions
|
@ -60,6 +60,8 @@ class Relation < ActiveRecord::Base
|
|||
relation.visible = true
|
||||
|
||||
pt.find('tag').each do |tag|
|
||||
raise OSM::APIBadXMLError.new("relation", pt, "tag is missing key") if tag['k'].nil?
|
||||
raise OSM::APIBadXMLError.new("relation", pt, "tag is missing value") if tag['v'].nil?
|
||||
relation.add_tag_keyval(tag['k'], tag['v'])
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue