Exception: MyJohnDeereApi::NetHttpRetry::InvalidResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/my_john_deere_api/net_http_retry/invalid_response_error.rb

Overview

This error is used when a single request has exceeded the number of retries allowed by NetHttpRetry::Decorator::MAX_RETRIES.

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ InvalidResponseError

argument is a string which describes the attempted request



12
13
14
15
16
17
18
19
20
# File 'lib/my_john_deere_api/net_http_retry/invalid_response_error.rb', line 12

def initialize(response)
  message = {
    code: response.status,
    message: response.response.reason_phrase,
    body: response.body,
  }.to_json

  super(message)
end