Exception: GoogleDistanceMatrix::ClientError

Inherits:
Error
  • Object
show all
Defined in:
lib/google_distance_matrix/errors.rb

Overview

Public: Got an error where the client seems to be doing something wrong

These errors comes from http 4xx errors, or API errors like MAX_ELEMENTS_EXCEEDED etc. See developers.google.com/maps/documentation/distancematrix/#StatusCodes for info.

Direct Known Subclasses

MatrixUrlTooLong

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, status_read_from_api_response = nil) ⇒ ClientError

Returns a new instance of ClientError.



57
58
59
60
# File 'lib/google_distance_matrix/errors.rb', line 57

def initialize(response, status_read_from_api_response = nil)
  @response = response
  @status_read_from_api_response = status_read_from_api_response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



55
56
57
# File 'lib/google_distance_matrix/errors.rb', line 55

def response
  @response
end

#status_read_from_api_responseObject (readonly)

Returns the value of attribute status_read_from_api_response.



55
56
57
# File 'lib/google_distance_matrix/errors.rb', line 55

def status_read_from_api_response
  @status_read_from_api_response
end

Instance Method Details

#to_sObject



62
63
64
# File 'lib/google_distance_matrix/errors.rb', line 62

def to_s
  "GoogleDistanceMatrix::ClientError - #{[response, status_read_from_api_response].compact.join('. ')}."
end