Exception: Mints::Errors::DynamicError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Mints::Errors::DynamicError
- Defined in:
- lib/errors.rb
Constant Summary collapse
- ERRORS =
{ '401' => 'AccessDeniedException', '404' => 'ResourceNotFoundException', '422' => 'ValidationException', '405' => 'MethodNotAllowedException', 'default' => 'InternalServerException', }
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
-
#initialize(client, title, detail, http_status, response) ⇒ DynamicError
constructor
A new instance of DynamicError.
- #to_s ⇒ Object
Constructor Details
#initialize(client, title, detail, http_status, response) ⇒ DynamicError
Returns a new instance of DynamicError.
18 19 20 21 |
# File 'lib/errors.rb', line 18 def initialize(client, title, detail, http_status, response) @http_status = http_status @error = error_class.constantize&.new(client, title, detail, http_status, response) end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
23 24 25 |
# File 'lib/errors.rb', line 23 def error @error end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
23 24 25 |
# File 'lib/errors.rb', line 23 def http_status @http_status end |
Instance Method Details
#to_s ⇒ Object
25 26 27 |
# File 'lib/errors.rb', line 25 def to_s error_class end |