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.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#retryable ⇒ Object
readonly
Returns the value of attribute retryable.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
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.
68 69 70 71 72 73 74 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 68 def initialize(branch_key:, error:) validate_arguments!(branch_key, error) @branch_key = branch_key.dup.freeze copy_error_attributes(error) @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.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def branch_key @branch_key end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def details @details end |
#error_class ⇒ Object (readonly)
Returns the value of attribute error_class.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def error_class @error_class end |
#error_family ⇒ Object (readonly)
Returns the value of attribute error_family.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def error_family @error_family end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def kind @kind end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def reason @reason end |
#retryable ⇒ Object (readonly)
Returns the value of attribute retryable.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def retryable @retryable end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
24 25 26 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 24 def tool_name @tool_name end |
Class Method Details
.from_details(details) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/smith/workflow/composite/branch_failure.rb', line 26 def self.from_details(details) values = normalize_details(details) error_attributes = { class_name: values.fetch(:error_class), family: values.fetch(:error_family), retryable: values.fetch(:retryable), kind: values.fetch(:kind) } OPTIONAL_DETAIL_NAMES.each do |name| error_attributes[name] = values[name] if values.key?(name) end error = Error.new(error_attributes) new(branch_key: values.fetch(:branch_key), error:) end |