Exception: Deimos::BatchFallbackError
- Inherits:
-
StandardError
- Object
- StandardError
- Deimos::BatchFallbackError
- Defined in:
- lib/deimos/exceptions.rb
Overview
Raised when a batch database operation failed and the messages were retried one at a time. Every message that could be saved on its own has been saved; this carries the ones that could not, so that the offending keys show up in logging and error reporting.
Instance Attribute Summary collapse
-
#failures ⇒ Array<Array(Deimos::Message, StandardError)>
readonly
Each message that failed on its own, paired with the error it raised.
Instance Method Summary collapse
-
#initialize(failures) ⇒ BatchFallbackError
constructor
A new instance of BatchFallbackError.
Constructor Details
#initialize(failures) ⇒ BatchFallbackError
Returns a new instance of BatchFallbackError.
15 16 17 18 19 20 |
# File 'lib/deimos/exceptions.rb', line 15 def initialize(failures) @failures = failures details = failures.map { |, error| "#{.key.inspect} (#{error.})" } super("#{failures.size} message(s) could not be saved individually after the batch " \ "failed. Failed keys: #{details.join(', ')}") end |
Instance Attribute Details
#failures ⇒ Array<Array(Deimos::Message, StandardError)> (readonly)
Returns each message that failed on its own, paired with the error it raised.
12 13 14 |
# File 'lib/deimos/exceptions.rb', line 12 def failures @failures end |