Exception: JetEmail::Error
- Inherits:
-
StandardError
- Object
- StandardError
- JetEmail::Error
- Defined in:
- lib/jetemail/errors.rb
Defined Under Namespace
Classes: RateLimitError
Constant Summary collapse
- ClientError =
Class.new(self)
- ServerError =
Class.new(self)
- InternalServerError =
Class.new(ServerError)
- InvalidRequestError =
Class.new(ClientError)
- NotFoundError =
Class.new(ClientError)
- ERRORS =
{ 400 => InvalidRequestError, 401 => InvalidRequestError, 403 => InvalidRequestError, 404 => NotFoundError, 422 => InvalidRequestError, 429 => RateLimitError, 500 => InternalServerError }.freeze
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(msg, code = nil, headers = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, code = nil, headers = {}) ⇒ Error
Returns a new instance of Error.
33 34 35 36 37 |
# File 'lib/jetemail/errors.rb', line 33 def initialize(msg, code = nil, headers = {}) super(msg) @status_code = code @headers = headers || {} end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
31 32 33 |
# File 'lib/jetemail/errors.rb', line 31 def headers @headers end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
31 32 33 |
# File 'lib/jetemail/errors.rb', line 31 def status_code @status_code end |