Error codes

The stable NF.PERSIST codes, grouped by subsystem, with the fix that belongs to each one.

Reference NexusForge Persistence 0.2.0 Updated

Why codes, not messages#

Codes are stable strings and messages are for humans. Branch on the code; show the message. Every expected failure arrives as a PersistenceResult, so a code is a value you can handle rather than a stack trace you have to parse.

Storage and slots#

CodeMeaningFix
NF.PERSIST.STORAGE.NOT_FOUNDThe slot was never writtenTreat LoadOutcome.NotFound as "new game", not as an error
NF.PERSIST.STORAGE.PATH_TOO_LONGNamespace + environment + slot exceeded the path budgetShorten the namespace, or raise Storage.MaxPathLength deliberately
NF.PERSIST.STORAGE.WRITE_FAILEDThe platform refused the writeCheck free space, permissions and whether another process holds the file
NF.PERSIST.SLOT.NOT_FOUNDThe named slot does not existSame as above: it is an outcome, not an incident

Lifecycle#

CodeMeaningFix
NF.PERSIST.LIFECYCLE.NOT_INITIALIZEDA save was attempted before InitializeCall Initialize during startup
NF.PERSIST.LIFECYCLE.INIT_REJECTEDA second initialisation was refused; the new host was discardedCall ResetForNewSession() first if you intend to replace the running host

Envelope, serialization and migration#

CodeMeaningFix
NF.PERSIST.ENVELOPE.INTEGRITY_MISMATCHThe file is damagedUse recovery — the framework restores the newest valid backup
NF.PERSIST.SERIALIZATION.MALFORMEDThe document does not match the modelUsually a model change without a migration, or a member the type cannot represent
NF.PERSIST.MIGRATION.PATH_MISSINGA migration step is missing for a schema in the saveRegister the step, and declare the versions so validation catches it first

Security#

CodeMeaningFix
NF.PERSIST.SECURITY.KEY_UNAVAILABLEEncryption or authentication is configured and no key was suppliedRegister an ISaveKeyProvider, or turn encryption off
NF.PERSIST.SECURITY.AUTHENTICATION_FAILEDThe file was altered, or not written with the supplied keyCheck the key provider and Security.KeyId; nothing was read or decrypted

Next#

Something wrong on this page? Every page here describes behaviour that is checked in the repository. If a page and the package disagree, the package wins.

Report a documentation problem · Frequently asked questions · Troubleshooting