Exception: SendGridMailer::ApiError
- Defined in:
- lib/send_grid_mailer/errors.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(error_code, errors) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(error_code, errors) ⇒ ApiError
Returns a new instance of ApiError.
14 15 16 17 18 19 |
# File 'lib/send_grid_mailer/errors.rb', line 14 def initialize(error_code, errors) @error_code = error_code @errors = errors = errors.map { |err| err['message'] }.join('. ') super("Sendgrid API error. Code: #{error_code}. Errors: #{}") end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
12 13 14 |
# File 'lib/send_grid_mailer/errors.rb', line 12 def error_code @error_code end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
12 13 14 |
# File 'lib/send_grid_mailer/errors.rb', line 12 def errors @errors end |