Error codes

Every code PersistKit reports, what caused it, whether anything was changed, and what to do next.

Reference NexusForge Persistence 1.0.0 Updated

How to read a failure#

csharp
var result = Persist.Save(class="tok-str">"score", 1500);

if (!result.Ok)
{
    Debug.LogWarning(result.Code);      // class="tok-str">"PK-STORAGE-001"
    Debug.LogWarning(result.Message);   // what happened, in one sentence
    Debug.LogWarning(result.NextStep);  // what to try next
}

Nothing is changed by a failure unless the code says otherwise, and no failure is ever thrown for an ordinary condition such as a full disk.

Storage and format#

CodeCauseChanged anything?
PK-STORAGE-001The save file could not be writtenNo: the previous file is still there
PK-STORAGE-002The save file could not be readNo
PK-FORMAT-001Not a PersistKit save, a newer container, or a protected save with no passphrase in this buildNo
PK-VERSION-001The save came from a newer build of the gameNo: the file is left exactly as it was
PK-INTEGRITY-001The file was changed or damaged after it was writtenNo: the damaged file is kept where it is

Types and values#

CodeCauseChanged anything?
PK-TYPE-001That kind of value cannot be stored, so nothing was savedNo
PK-VALUE-001The saved value cannot be read as the type you asked forNo

References, objects and assets#

CodeCauseChanged anything?
PK-REF-001The object that save points at is not in the loaded scenesNo: your default is returned
PK-REF-002That object has no identity, so it cannot be found againNo
PK-REF-003More than one object claims the same identityNo: nothing is picked at random
PK-REF-004That asset has no place in the registryNo: press Register this asset
PK-REF-005This build cannot resolve that asset key (or the entry is empty)No
PK-REF-006One key names two assets, or one asset has two keysNo
PK-REF-007That key cannot be made into a scene object, or the object was not made by Persist.SpawnNo

Scenes, objects and time away#

CodeWhat it meansWas anything changed?
PK-SCENE-001A scene a save expects is not loaded, so its objects could not be restoredNo: nothing is invented
PK-SCENE-002An object a save expects is missing from the loaded scenesNo
PK-SCENE-003An object's parent is missing, so it was restored at the top level insteadYes: the object was restored, at the top level
PK-SCENE-004That object is not followed by the scene tracker, so it cannot be restoredNo
PK-INSTANCE-001That instance was retired, so it is deliberately not created againNo: the save file is untouched
PK-OFFLINE-001The device's clock is behind the last time this save was seen, so no time away is claimedNo
PK-OFFLINE-002The note about when this save was last seen could not be read, so the time away is not knownNo

PK-INSTANCE-001 is what retiring an object reports when a game asks for one the player destroyed for good.

Slots and recovery#

CodeCauseChanged anything?
PK-SLOT-001That slot name cannot be usedNo
PK-SLOT-002There is no slot with that nameNo
PK-SLOT-003A slot's description file could not be trustedNo: the data can still be loaded
PK-SLOT-004That slot exists but holds no saved dataNo
PK-SLOT-005That would delete or replace saved data, and was not confirmedNo
PK-SLOT-006A slot with that name already existsNo
PK-RECOVERY-001There is no usable backup to go back toNo
PK-RECOVERY-002The current file was missing, so a copy was usedNo: the copy is still on disk

Cloud#

CodeCauseChanged anything?
PK-CLOUD-001No provider is setNo
PK-CLOUD-002The cloud could not be reachedNo
PK-CLOUD-003The service refused (credentials, permission, quota)No
PK-CLOUD-004Both copies changed, so a choice is neededNo: neither copy is touched
PK-CLOUD-005The transfer was cancelledNo
PK-CLOUD-006There is nothing stored remotely under that nameNo
PK-CLOUD-007The download arrived but cannot be usedNo: the local copy is kept
PK-CLOUD-008The provider does not support that operationNo
PK-CLOUD-009The transfer took too long and was stoppedNo

Migration#

CodeCauseChanged anything?
PK-MIGRATION-001No migration is registered for a step in the walkNo: the save was not loaded
PK-MIGRATION-002A migration step failedNo: the file is exactly as it was
PK-MIGRATION-003The migrations produced something this build cannot readNo: nothing was committed
PK-MIGRATION-004The migrated file could not be writtenThe previous file was put back

Seeing it in one place#

Tools → PersistKit → Diagnostics (and Persist.Diagnostics.Report()) gathers the versions, the save folder, every slot's state and size, and the last problem — read from disk when the report is built, so a file that changed behind PersistKit's back cannot be hidden by anything remembered.

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 · Error codes · Platforms and limitations