Exception: GoogleDistanceMatrix::ClientError
- 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
Instance Attribute Summary collapse
- 
  
    
      #response  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute response. 
- 
  
    
      #status_read_from_api_response  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute status_read_from_api_response. 
Instance Method Summary collapse
- 
  
    
      #initialize(response, status_read_from_api_response = nil)  ⇒ ClientError 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ClientError. 
- #to_s ⇒ Object
Constructor Details
#initialize(response, status_read_from_api_response = nil) ⇒ ClientError
Returns a new instance of ClientError.
| 66 67 68 69 | # File 'lib/google_distance_matrix/errors.rb', line 66 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
#response ⇒ Object (readonly)
Returns the value of attribute response.
| 64 65 66 | # File 'lib/google_distance_matrix/errors.rb', line 64 def response @response end | 
#status_read_from_api_response ⇒ Object (readonly)
Returns the value of attribute status_read_from_api_response.
| 64 65 66 | # File 'lib/google_distance_matrix/errors.rb', line 64 def status_read_from_api_response @status_read_from_api_response end | 
Instance Method Details
#to_s ⇒ Object
| 71 72 73 74 | # File 'lib/google_distance_matrix/errors.rb', line 71 def to_s "GoogleDistanceMatrix::ClientError - \ #{[response, status_read_from_api_response].compact.join('. ')}." end |