Exception: Emarsys::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Emarsys::Error
- Defined in:
- lib/emarsys/error.rb
Overview
Custom error class for rescuing from Emarsys errors
Direct Known Subclasses
BadRequest, InternalServerError, TooManyRequests, Unauthorized
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #build_error_message ⇒ Object
-
#initialize(code, text, status) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(code, text, status) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 |
# File 'lib/emarsys/error.rb', line 7 def initialize(code, text, status) @code = code @text = text @status = status super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/emarsys/error.rb', line 5 def code @code end |
Instance Method Details
#build_error_message ⇒ Object
14 15 16 |
# File 'lib/emarsys/error.rb', line 14 def "HTTP-Code: #{@status}, Emarsys-Code: #{@code} - #{@text}" end |