Exception: Acta::FutureSchemaVersion

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

Overview

Raised when a record’s stored event_version exceeds anything the currently-loaded upcaster registry knows how to reach. Typically means an older deployment is replaying events emitted by a newer one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record:, latest_known_version:) ⇒ FutureSchemaVersion

Returns a new instance of FutureSchemaVersion.



129
130
131
132
133
134
135
136
137
138
# File 'lib/acta/errors.rb', line 129

def initialize(record:, latest_known_version:)
  @record = record
  @latest_known_version = latest_known_version
  super(
    "Event id=#{record.id} uuid=#{record.uuid} (#{record.event_type}) is at " \
    "event_version #{record.event_version}, but the loaded upcaster registry " \
    "only knows up to v#{latest_known_version}. Likely an older deployment " \
    "replaying events emitted by a newer one."
  )
end

Instance Attribute Details

#latest_known_versionObject (readonly)

Returns the value of attribute latest_known_version.



127
128
129
# File 'lib/acta/errors.rb', line 127

def latest_known_version
  @latest_known_version
end

#recordObject (readonly)

Returns the value of attribute record.



127
128
129
# File 'lib/acta/errors.rb', line 127

def record
  @record
end