X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/083a8bb043c3ea0b0f52d5c0d3abe213624e1038..c809f79912a3b998ddf3a21973582254db564183:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 393011dac..ba28378f3 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -298,6 +298,23 @@ module OSM end end + # raised when a two preferences have a duplicate key string. + class APIDuplicatePreferenceError < APIError + def initialize(key) + @key = key + end + + attr_reader :key + + def status + :bad_request + end + + def to_s + "Duplicate preferences with key #{@key}" + end + end + # Helper methods for going to/from mercator and lat/lng. class Mercator include Math @@ -497,7 +514,7 @@ module OSM country = "GB" if country == "UK" end end - + return country.upcase end