Exception: Taski::AggregateError
- Inherits:
-
StandardError
- Object
- StandardError
- Taski::AggregateError
- Defined in:
- lib/taski.rb
Overview
Raised when multiple tasks fail during parallel execution
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#cause ⇒ Exception?
Returns the first error for compatibility with exception chaining.
-
#includes?(exception_class) ⇒ Boolean
Check if this aggregate contains an error of the given type.
-
#initialize(errors) ⇒ AggregateError
constructor
A new instance of AggregateError.
Constructor Details
#initialize(errors) ⇒ AggregateError
125 126 127 128 |
# File 'lib/taski.rb', line 125 def initialize(errors) @errors = errors super() end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
122 123 124 |
# File 'lib/taski.rb', line 122 def errors @errors end |
Instance Method Details
#cause ⇒ Exception?
Returns the first error for compatibility with exception chaining
132 133 134 |
# File 'lib/taski.rb', line 132 def cause errors.first&.error end |
#includes?(exception_class) ⇒ Boolean
Check if this aggregate contains an error of the given type
139 140 141 |
# File 'lib/taski.rb', line 139 def includes?(exception_class) errors.any? { |f| f.error.is_a?(exception_class) } end |