Exception: Payu::ApiError
- Defined in:
- lib/payu/errors.rb
Overview
Raised by Payu::Http. Carries the HTTP status and raw body when available so callers can distinguish failure modes instead of pattern matching on the message.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(msg = nil, status: nil, body: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(msg = nil, status: nil, body: nil) ⇒ ApiError
Returns a new instance of ApiError.
14 15 16 17 18 |
# File 'lib/payu/errors.rb', line 14 def initialize(msg = nil, status: nil, body: nil) super(msg) @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
12 13 14 |
# File 'lib/payu/errors.rb', line 12 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/payu/errors.rb', line 12 def status @status end |