Exception: Aikido::Zen::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/aikido/zen/errors.rb

Overview

Raised whenever a request to the API results in a 4XX or 5XX response.

Direct Known Subclasses

RateLimitedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, response) ⇒ APIError

Returns a new instance of APIError.



38
39
40
41
42
43
# File 'lib/aikido/zen/errors.rb', line 38

def initialize(request, response)
  @request = anonimize_token(request.dup)
  @response = response

  super("Error in #{request.method} #{request.path}: #{response.code} #{response.message} (#{response.body})")
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



35
36
37
# File 'lib/aikido/zen/errors.rb', line 35

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



36
37
38
# File 'lib/aikido/zen/errors.rb', line 36

def response
  @response
end