Exception: Bunny::AccumulatedExceptions

Inherits:
Exception
  • Object
show all
Defined in:
lib/bunny/exceptions.rb

Overview

Exception wrapper that holds multiple accumulated exceptions. Raised by ExceptionAccumulator#raise_all! when multiple exceptions occurred.

API:

  • public

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exceptions) ⇒ AccumulatedExceptions

Returns a new instance of AccumulatedExceptions.

API:

  • public



294
295
296
297
298
# File 'lib/bunny/exceptions.rb', line 294

def initialize(exceptions)
  @exceptions = exceptions
  messages = exceptions.map { |e| "#{e.class}: #{e.message}" }
  super("#{exceptions.count} exception(s) accumulated:\n  #{messages.join("\n  ")}")
end

Instance Attribute Details

#exceptionsObject (readonly)

API:

  • public



292
293
294
# File 'lib/bunny/exceptions.rb', line 292

def exceptions
  @exceptions
end