Exception: ScalewayTem::ActionMailer::DeliveryError
- Defined in:
- lib/scaleway_tem/action_mailer/errors.rb
Overview
Scaleway answered, and the answer was not a success. Carries the HTTP status and, when the body parsed, the API's own message. Both are kept as attributes rather than only interpolated into the message so that callers can branch on the status (a 429 deserves a retry, a 403 does not).
Instance Attribute Summary collapse
-
#api_message ⇒ Object
readonly
Returns the value of attribute api_message.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, status: nil, api_message: nil, body: nil) ⇒ DeliveryError
constructor
A new instance of DeliveryError.
Constructor Details
#initialize(message, status: nil, api_message: nil, body: nil) ⇒ DeliveryError
Returns a new instance of DeliveryError.
22 23 24 25 26 27 |
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 22 def initialize(, status: nil, api_message: nil, body: nil) super() @status = status @api_message = @body = body end |
Instance Attribute Details
#api_message ⇒ Object (readonly)
Returns the value of attribute api_message.
20 21 22 |
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 20 def @api_message end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
20 21 22 |
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 20 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
20 21 22 |
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 20 def status @status end |