Exception: ActiveItem::ItemTooLargeError
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveItem::ItemTooLargeError
- Defined in:
- lib/active_item/errors.rb
Overview
Raised when a DynamoDB put/update fails because the item exceeds the 400KB size limit — typically due to large embedded collections.
Instance Attribute Summary collapse
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(model_name:, table:, original_error: nil) ⇒ ItemTooLargeError
constructor
A new instance of ItemTooLargeError.
Constructor Details
#initialize(model_name:, table:, original_error: nil) ⇒ ItemTooLargeError
Returns a new instance of ItemTooLargeError.
75 76 77 78 79 80 81 82 83 |
# File 'lib/active_item/errors.rb', line 75 def initialize(model_name:, table:, original_error: nil) @model_name = model_name @table = table msg = "Item exceeds DynamoDB's 400KB limit when saving #{model_name} to #{table}. " \ 'The embedded collection(s) may have too many records. ' \ 'Consider reducing the number of embedded items or moving them to a separate table.' msg += " (Original: #{original_error.})" if original_error super(msg) end |
Instance Attribute Details
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
73 74 75 |
# File 'lib/active_item/errors.rb', line 73 def model_name @model_name end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
73 74 75 |
# File 'lib/active_item/errors.rb', line 73 def table @table end |