Exception: Smith::PersistenceSchemaMismatch

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

Overview

Raised when restoring a persisted payload whose schema_version does not match the workflow's current persistence_schema_version AND no migration block is registered to bridge the gap. Hosts fix this by adding migrate_from(stored) do |payload| ... end to the workflow class, or by bumping persistence_schema_version to match the stored version. Downgrades (stored > current) always raise; Smith has no rollback semantics.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow:, stored:, current:) ⇒ PersistenceSchemaMismatch

Returns a new instance of PersistenceSchemaMismatch.



181
182
183
184
185
186
# File 'lib/smith/errors.rb', line 181

def initialize(workflow:, stored:, current:)
  @workflow = workflow
  @stored = stored
  @current = current
  super(format_message(workflow, stored, current))
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



179
180
181
# File 'lib/smith/errors.rb', line 179

def current
  @current
end

#storedObject (readonly)

Returns the value of attribute stored.



179
180
181
# File 'lib/smith/errors.rb', line 179

def stored
  @stored
end

#workflowObject (readonly)

Returns the value of attribute workflow.



179
180
181
# File 'lib/smith/errors.rb', line 179

def workflow
  @workflow
end