Exception: GoogleDistanceMatrix::MatrixUrlTooLong
- Inherits:
-
ClientError
- Object
- StandardError
- Error
- ClientError
- GoogleDistanceMatrix::MatrixUrlTooLong
- Defined in:
- lib/google_distance_matrix/errors.rb
Overview
Public: API URL was too long
See developers.google.com/maps/documentation/distancematrix/#Limits, which states: “Distance Matrix API URLs are restricted to 2048 characters, before URL encoding.” “As some Distance Matrix API service URLs may involve many locations, be aware of this limit when constructing your URLs.”
Instance Attribute Summary collapse
-
#max_url_size ⇒ Object
readonly
Returns the value of attribute max_url_size.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from ClientError
#response, #status_read_from_api_response
Instance Method Summary collapse
-
#initialize(url, max_url_size, response = nil) ⇒ MatrixUrlTooLong
constructor
A new instance of MatrixUrlTooLong.
- #to_s ⇒ Object
Constructor Details
#initialize(url, max_url_size, response = nil) ⇒ MatrixUrlTooLong
Returns a new instance of MatrixUrlTooLong.
76 77 78 79 80 81 |
# File 'lib/google_distance_matrix/errors.rb', line 76 def initialize(url, max_url_size, response = nil) super response @url = url @max_url_size = max_url_size end |
Instance Attribute Details
#max_url_size ⇒ Object (readonly)
Returns the value of attribute max_url_size.
74 75 76 |
# File 'lib/google_distance_matrix/errors.rb', line 74 def max_url_size @max_url_size end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
74 75 76 |
# File 'lib/google_distance_matrix/errors.rb', line 74 def url @url end |
Instance Method Details
#to_s ⇒ Object
83 84 85 |
# File 'lib/google_distance_matrix/errors.rb', line 83 def to_s "Matrix API URL max size is: #{max_url_size}. Built URL was: #{url.length}. URL: '#{url}'." end |