Exception: Familia::IndexedFieldFastWriteError
- Inherits:
-
PersistenceError
- Object
- RuntimeError
- Problem
- PersistenceError
- Familia::IndexedFieldFastWriteError
- Defined in:
- lib/familia/errors.rb
Overview
Raised when a fast-write method is asked to write a field that backs a class-level index and cannot run the index claim first, which the fail-closed ordering in ADR-0002 requires.
multi_field_fast_write raises it outside a transaction or pipeline, since its single HMSET leaves no room for the claim: use multi_field_update, save_fields or save there. A field! fast writer raises it inside a transaction or pipeline, where the claim cannot run and where multi_field_update, save_fields and save raise Familia::OperationModeError too: call field! or one of those methods before or after the block.
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#index_name ⇒ Object
readonly
Returns the value of attribute index_name.
-
#inside_block ⇒ Object
readonly
Returns the value of attribute inside_block.
-
#offenders ⇒ Object
readonly
Returns the value of attribute offenders.
Instance Method Summary collapse
-
#initialize(field, index_name, offenders: nil, inside_block: false) ⇒ IndexedFieldFastWriteError
constructor
A new instance of IndexedFieldFastWriteError.
Constructor Details
#initialize(field, index_name, offenders: nil, inside_block: false) ⇒ IndexedFieldFastWriteError
Returns a new instance of IndexedFieldFastWriteError.
265 266 267 268 269 270 271 |
# File 'lib/familia/errors.rb', line 265 def initialize(field, index_name, offenders: nil, inside_block: false) @field = field @index_name = index_name @offenders = offenders || [[field, index_name]] @inside_block = inside_block super() end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
254 255 256 |
# File 'lib/familia/errors.rb', line 254 def field @field end |
#index_name ⇒ Object (readonly)
Returns the value of attribute index_name.
254 255 256 |
# File 'lib/familia/errors.rb', line 254 def index_name @index_name end |
#inside_block ⇒ Object (readonly)
Returns the value of attribute inside_block.
254 255 256 |
# File 'lib/familia/errors.rb', line 254 def inside_block @inside_block end |
#offenders ⇒ Object (readonly)
Returns the value of attribute offenders.
254 255 256 |
# File 'lib/familia/errors.rb', line 254 def offenders @offenders end |