Exception: Smith::PersistenceVersionConflict
- Defined in:
- lib/smith/errors.rb
Overview
Raised when an adapter's optimistic-lock check detects a concurrent write: another process modified the key between this process's restore and persist. Hosts can rescue + restore + retry, or fail the workflow run with explicit conflict semantics.
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key:, expected:, actual:) ⇒ PersistenceVersionConflict
constructor
A new instance of PersistenceVersionConflict.
Constructor Details
#initialize(key:, expected:, actual:) ⇒ PersistenceVersionConflict
Returns a new instance of PersistenceVersionConflict.
117 118 119 120 121 122 |
# File 'lib/smith/errors.rb', line 117 def initialize(key:, expected:, actual:) @key = key @expected = expected @actual = actual super("persistence version conflict for #{key.inspect}: expected v#{expected}, got #{actual.inspect}") end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
115 116 117 |
# File 'lib/smith/errors.rb', line 115 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
115 116 117 |
# File 'lib/smith/errors.rb', line 115 def expected @expected end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
115 116 117 |
# File 'lib/smith/errors.rb', line 115 def key @key end |