Exception: Aikido::Zen::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Aikido::Zen::APIError
- 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
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(request, response) ⇒ APIError
constructor
A new instance of APIError.
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.} (#{response.body})") end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
35 36 37 |
# File 'lib/aikido/zen/errors.rb', line 35 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
36 37 38 |
# File 'lib/aikido/zen/errors.rb', line 36 def response @response end |