X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/550c4a3a45814fde5c809334c85f1ebc47659a82..d2f26a54367fcdd568b83a2cc4c188117fcfe731:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 73513c3ad..6d945c4fe 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -353,6 +353,13 @@ module OSM end end + # Raised when a rate limit is exceeded + class APIRateLimitExceeded < APIError + def status + :too_many_requests + end + end + # Helper methods for going to/from mercator and lat/lng. class Mercator include Math @@ -520,7 +527,7 @@ module OSM # Return the HTTP client to use def self.http_client - @http_client ||= Faraday.new + @http_client ||= Faraday.new(:request => { :timeout => 15 }) end # Return the MaxMindDB database handle