Exception: ScalewayTem::ActionMailer::DeliveryError

Inherits:
Error
  • Object
show all
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

Instance Method Summary collapse

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(message, status: nil, api_message: nil, body: nil)
  super(message)
  @status = status
  @api_message = api_message
  @body = body
end

Instance Attribute Details

#api_messageObject (readonly)

Returns the value of attribute api_message.



20
21
22
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 20

def api_message
  @api_message
end

#bodyObject (readonly)

Returns the value of attribute body.



20
21
22
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 20

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



20
21
22
# File 'lib/scaleway_tem/action_mailer/errors.rb', line 20

def status
  @status
end