Exception: GoogleMaps::Services::Exceptions::HTTPError

Inherits:
TransportError
  • Object
show all
Defined in:
lib/googlemaps/services/exceptions.rb

Overview

Represents an unexpected HTTP error.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code) ⇒ HTTPError

Returns a new instance of HTTPError.

Since:

  • 1.0.0



27
28
29
# File 'lib/googlemaps/services/exceptions.rb', line 27

def initialize(status_code)
  self.status_code = status_code
end

Instance Attribute Details

#status_codeSymbol

Returns status_code The response status code.

Returns:

  • (Symbol)

    status_code The response status code.

Since:

  • 1.0.0



25
26
27
# File 'lib/googlemaps/services/exceptions.rb', line 25

def status_code
  @status_code
end

Instance Method Details

#to_sString

Returns the string representation of this error.

Returns:

  • (String)

    Human-readable error string.

Since:

  • 1.0.0



34
35
36
# File 'lib/googlemaps/services/exceptions.rb', line 34

def to_s
  "HTTP Error: #{self.status_code}"
end