Exception: WeInc::Error
- Inherits:
-
StandardError
- Object
- StandardError
- WeInc::Error
- Defined in:
- lib/weinc/client.rb
Overview
Raised for every failed request (non-2xx response, network failure, or invalid input).
Instance Attribute Summary collapse
-
#body ⇒ Object?
readonly
Parsed response body (Hash/Array if JSON, else raw String).
-
#status ⇒ Integer?
readonly
HTTP status code, if a response was received.
Instance Method Summary collapse
-
#initialize(message, status: nil, body: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, status: nil, body: nil) ⇒ Error
Returns a new instance of Error.
18 19 20 21 22 |
# File 'lib/weinc/client.rb', line 18 def initialize(, status: nil, body: nil) super() @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object? (readonly)
Returns Parsed response body (Hash/Array if JSON, else raw String).
15 16 17 18 19 20 21 22 23 |
# File 'lib/weinc/client.rb', line 15 class Error < StandardError attr_reader :status, :body def initialize(, status: nil, body: nil) super() @status = status @body = body end end |
#status ⇒ Integer? (readonly)
Returns HTTP status code, if a response was received.
15 16 17 18 19 20 21 22 23 |
# File 'lib/weinc/client.rb', line 15 class Error < StandardError attr_reader :status, :body def initialize(, status: nil, body: nil) super() @status = status @body = body end end |