Exception: ReverseGeocode::GeocodeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/reverse_geocode.rb

Overview

Used to raise Google API errors

Constant Summary collapse

ERRORS =
{
  400 => "Bad Request",
  500 => "Server Error",
  601 => "Missing Query or Address",
  602 => "Unknown Address",
  603 => "Unavailable Address",
  604 => "Unknown Directions",
  610 => "Bad Key",
  620 => "Too Many Queries"
}

Instance Method Summary collapse

Constructor Details

#initialize(error_code) ⇒ GeocodeError

Returns a new instance of GeocodeError.



26
27
28
# File 'lib/reverse_geocode.rb', line 26

def initialize(error_code)
  super("#{error_code}: #{ERRORS[error_code] || 'Unknown Error'}")
end