end
end
+ # Raised when access is denied.
+ class APIAccessDenied < RuntimeError
+ def status
+ :forbidden
+ end
+
+ def to_s
+ "Access denied"
+ end
+ end
+
# Raised when an API object is not found.
class APINotFoundError < APIError
def status
begin
lonradius = 2 * asin(sqrt(sin(radius / 6372.795 / 2) ** 2 / cos(@lat) ** 2))
- rescue Errno::EDOM
+ rescue Errno::EDOM, Math::DomainError
lonradius = PI
end