Exception: Smith::Workflow::Composite::BranchFailure
- Inherits:
-
Smith::WorkflowError
- Object
- StandardError
- Error
- Smith::WorkflowError
- Smith::Workflow::Composite::BranchFailure
- Defined in:
- lib/smith/workflow/composite/branch_failure.rb
Instance Attribute Summary collapse
-
#branch_key ⇒ Object
readonly
Returns the value of attribute branch_key.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#error_class ⇒ Object
readonly
Returns the value of attribute error_class.
-
#error_family ⇒ Object
readonly
Returns the value of attribute error_family.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#retryable ⇒ Object
readonly
Returns the value of attribute retryable.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(branch_key:, error:) ⇒ BranchFailure
constructor
A new instance of BranchFailure.
Constructor Details
#initialize(branch_key:, error:) ⇒ BranchFailure
Returns a new instance of BranchFailure.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 60 def initialize(branch_key:, error:) validate_arguments!(branch_key, error) @branch_key = branch_key.dup.freeze @error_class = error.class_name.dup.freeze @error_family = error.family.dup.freeze @retryable = error.retryable @kind = error.kind&.dup&.freeze @details = failure_details super("composite branch #{branch_key.inspect} failed") end |
Instance Attribute Details
#branch_key ⇒ Object (readonly)
Returns the value of attribute branch_key.
20 21 22 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 20 def branch_key @branch_key end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
20 21 22 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 20 def details @details end |
#error_class ⇒ Object (readonly)
Returns the value of attribute error_class.
20 21 22 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 20 def error_class @error_class end |
#error_family ⇒ Object (readonly)
Returns the value of attribute error_family.
20 21 22 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 20 def error_family @error_family end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
20 21 22 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 20 def kind @kind end |
#retryable ⇒ Object (readonly)
Returns the value of attribute retryable.
20 21 22 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 20 def retryable @retryable end |
Class Method Details
.from_details(details) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 22 def self.from_details(details) values = normalize_details(details) error = Error.new( class_name: values.fetch(:error_class), family: values.fetch(:error_family), retryable: values.fetch(:retryable), kind: values.fetch(:kind) ) new(branch_key: values.fetch(:branch_key), error:) end |