Class: Concurrent::MultipleErrors
- Defined in:
- lib/concurrent-ruby/concurrent/errors.rb
Overview
Aggregates multiple exceptions.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors, message = "#{errors.size} errors") ⇒ MultipleErrors
constructor
A new instance of MultipleErrors.
Constructor Details
#initialize(errors, message = "#{errors.size} errors") ⇒ MultipleErrors
Returns a new instance of MultipleErrors.
61 62 63 64 65 66 |
# File 'lib/concurrent-ruby/concurrent/errors.rb', line 61 def initialize(errors, = "#{errors.size} errors") @errors = errors super [*, *errors.map { |e| [format('%s (%s)', e., e.class), *e.backtrace] }.flatten(1) ].join("\n") end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
59 60 61 |
# File 'lib/concurrent-ruby/concurrent/errors.rb', line 59 def errors @errors end |