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.
111 112 113 114 115 116 |
# File 'lib/smith/errors.rb', line 111 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.
109 110 111 |
# File 'lib/smith/errors.rb', line 109 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
109 110 111 |
# File 'lib/smith/errors.rb', line 109 def expected @expected end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
109 110 111 |
# File 'lib/smith/errors.rb', line 109 def key @key end |