morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::journal::SchemaMismatchError Struct Reference

Thrown by replay() when a recorded entry's payload fingerprint (LogEntry::schema) disagrees with the fingerprint this build computes for the same action, and no migration covers the pair. More...

#include <journal.hpp>

Inheritance diagram for morph::journal::SchemaMismatchError:

Public Member Functions

 SchemaMismatchError (std::string_view modelType, std::string_view actionType, std::string_view recorded, std::string_view current)
 Builds the message naming the action and both fingerprints.

Detailed Description

Thrown by replay() when a recorded entry's payload fingerprint (LogEntry::schema) disagrees with the fingerprint this build computes for the same action, and no migration covers the pair.

Without this signal the same situation reconstructs, successfully, a state that was never recorded — a renamed field decoding to its default, reported with as much confidence as a correct one. There is no "degraded" reconstruction to fall back to and no way to tell how much of the entry survived the decode, so this throws rather than warning: an audit trail that cannot be reconstructed faithfully must say so.

Who handles it
The caller of replay() / SessionLog::undoLast() — application-level reconstruction code, not the framework. The three answers available to it are: register a migration for the pair (see PayloadMigrationRegistry), restore a build whose fingerprint matches, or surface the failure. The framework deliberately offers no fourth.

Definition at line 43 of file journal.hpp.

Constructor & Destructor Documentation

◆ SchemaMismatchError()

morph::journal::SchemaMismatchError::SchemaMismatchError ( std::string_view modelType,
std::string_view actionType,
std::string_view recorded,
std::string_view current )
inline

Builds the message naming the action and both fingerprints.

Parameters
modelTypeLogEntry::modelType of the offending entry.
actionTypeLogEntry::actionType of the offending entry.
recordedFingerprint stamped on the entry when it was written.
currentFingerprint this build computes for that action.

Definition at line 49 of file journal.hpp.


The documentation for this struct was generated from the following file: