Exception: Kreator::Providers::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Kreator::Providers::Error
- Defined in:
- lib/kreator/providers/base.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#retryable ⇒ Object
readonly
Returns the value of attribute retryable.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, code: "provider_error", status: nil, retryable: false, details: {}) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(message, code: "provider_error", status: nil, retryable: false, details: {}) ⇒ Error
Returns a new instance of Error.
13 14 15 16 17 18 19 |
# File 'lib/kreator/providers/base.rb', line 13 def initialize(, code: "provider_error", status: nil, retryable: false, details: {}) super() @code = code.to_s @status = status @retryable = retryable @details = details || {} end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
11 12 13 |
# File 'lib/kreator/providers/base.rb', line 11 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
11 12 13 |
# File 'lib/kreator/providers/base.rb', line 11 def details @details end |
#retryable ⇒ Object (readonly)
Returns the value of attribute retryable.
11 12 13 |
# File 'lib/kreator/providers/base.rb', line 11 def retryable @retryable end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/kreator/providers/base.rb', line 11 def status @status end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kreator/providers/base.rb', line 21 def to_h { "code" => code, "class" => self.class.name, "message" => , "status" => status, "retryable" => retryable, "details" => details }.compact end |