Exception: Statecraft::TransitionConflict

Inherits:
Error
  • Object
show all
Defined in:
lib/statecraft/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record:, expected_from:) ⇒ TransitionConflict

Returns a new instance of TransitionConflict.



41
42
43
44
45
46
# File 'lib/statecraft/errors.rb', line 41

def initialize(record:, expected_from:)
  @record = record
  @expected_from = expected_from
  super("concurrent update detected for #{record.class.name}##{record.id}: " \
        "expected state #{expected_from.inspect}, another writer got there first")
end

Instance Attribute Details

#expected_from ⇒ Object (readonly)

Returns the value of attribute expected_from.



39
40
41
# File 'lib/statecraft/errors.rb', line 39

def expected_from
  @expected_from
end

#record ⇒ Object (readonly)

Returns the value of attribute record.



39
40
41
# File 'lib/statecraft/errors.rb', line 39

def record
  @record
end