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.



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

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.



175
176
177
# File 'lib/smith/errors.rb', line 175

def current
  @current
end

#storedObject (readonly)

Returns the value of attribute stored.



175
176
177
# File 'lib/smith/errors.rb', line 175

def stored
  @stored
end

#workflowObject (readonly)

Returns the value of attribute workflow.



175
176
177
# File 'lib/smith/errors.rb', line 175

def workflow
  @workflow
end