Exception: ActiveItem::BatchWriteError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_item/errors.rb

Overview

Raised when batch_write fails to write all items after retries.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_name:, table:, failed_count:, total_count:) ⇒ BatchWriteError

Returns a new instance of BatchWriteError.



25
26
27
28
29
30
31
# File 'lib/active_item/errors.rb', line 25

def initialize(model_name:, table:, failed_count:, total_count:)
  @model_name = model_name
  @table = table
  @failed_count = failed_count
  @total_count = total_count
  super("#{model_name} batch_write failed: #{failed_count} of #{total_count} items could not be written to #{table} after retries (DynamoDB throughput exceeded).")
end

Instance Attribute Details

#failed_countObject (readonly)

Returns the value of attribute failed_count.



23
24
25
# File 'lib/active_item/errors.rb', line 23

def failed_count
  @failed_count
end

#model_nameObject (readonly)

Returns the value of attribute model_name.



23
24
25
# File 'lib/active_item/errors.rb', line 23

def model_name
  @model_name
end

#tableObject (readonly)

Returns the value of attribute table.



23
24
25
# File 'lib/active_item/errors.rb', line 23

def table
  @table
end

#total_countObject (readonly)

Returns the value of attribute total_count.



23
24
25
# File 'lib/active_item/errors.rb', line 23

def total_count
  @total_count
end