Exception: DbBlaster::OneRecordTooLargeError
- Inherits:
-
StandardError
- Object
- StandardError
- DbBlaster::OneRecordTooLargeError
- Defined in:
- lib/db_blaster/one_record_too_large_error.rb
Overview
Custom error representing a serious error.
If one individual record is larger than the max bytes
allowed, db_blaster "fails fast".
If we ignored this record and moved on, it would never make it
to SNS as its updated_at would end up being less than the
last processed record.
Possible fixes:
- if possible ignore the column(s) that are too large
- manually move the record to the intended destination
- bug me to provide an S3 workaround
Instance Attribute Summary collapse
-
#max_kilobytes ⇒ Object
readonly
Returns the value of attribute max_kilobytes.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#source_table ⇒ Object
readonly
Returns the value of attribute source_table.
Instance Method Summary collapse
-
#initialize(params) ⇒ OneRecordTooLargeError
constructor
A new instance of OneRecordTooLargeError.
- #message ⇒ Object
Constructor Details
#initialize(params) ⇒ OneRecordTooLargeError
Returns a new instance of OneRecordTooLargeError.
17 18 19 20 21 22 |
# File 'lib/db_blaster/one_record_too_large_error.rb', line 17 def initialize(params) super params.each_key do |key| instance_variable_set("@#{key}", params[key]) end end |
Instance Attribute Details
#max_kilobytes ⇒ Object (readonly)
Returns the value of attribute max_kilobytes.
15 16 17 |
# File 'lib/db_blaster/one_record_too_large_error.rb', line 15 def max_kilobytes @max_kilobytes end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
15 16 17 |
# File 'lib/db_blaster/one_record_too_large_error.rb', line 15 def record @record end |
#source_table ⇒ Object (readonly)
Returns the value of attribute source_table.
15 16 17 |
# File 'lib/db_blaster/one_record_too_large_error.rb', line 15 def source_table @source_table end |
Instance Method Details
#message ⇒ Object
24 25 26 27 28 |
# File 'lib/db_blaster/one_record_too_large_error.rb', line 24 def ["One individual record with ID '#{record[:id]}'", " in source-table '#{source_table.name}'", " is larger than #{max_kilobytes} KB!"].join(' ') end |