Exception: Conductor::ApiError
- Inherits:
-
ConductorError
- Object
- StandardError
- ConductorError
- Conductor::ApiError
- Defined in:
- lib/conductor/exceptions.rb
Overview
API-level exception (HTTP errors from server)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, code: nil, reason: nil, body: nil, headers: nil) ⇒ ApiError
constructor
A new instance of ApiError.
- #not_found? ⇒ Boolean
Constructor Details
#initialize(message = nil, status: nil, code: nil, reason: nil, body: nil, headers: nil) ⇒ ApiError
Returns a new instance of ApiError.
14 15 16 17 18 19 20 21 |
# File 'lib/conductor/exceptions.rb', line 14 def initialize( = nil, status: nil, code: nil, reason: nil, body: nil, headers: nil) @status = status @code = code || status @reason = reason @body = body @headers = headers super( || ) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
12 13 14 |
# File 'lib/conductor/exceptions.rb', line 12 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
12 13 14 |
# File 'lib/conductor/exceptions.rb', line 12 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
12 13 14 |
# File 'lib/conductor/exceptions.rb', line 12 def headers @headers end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
12 13 14 |
# File 'lib/conductor/exceptions.rb', line 12 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/conductor/exceptions.rb', line 12 def status @status end |
Instance Method Details
#not_found? ⇒ Boolean
23 24 25 |
# File 'lib/conductor/exceptions.rb', line 23 def not_found? @code == 404 end |