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
# 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