How-To: Handle Save/Load Errors
Goal: give the player resilient feedback when a save or load partially fails, and know when an asynchronous operation has actually finished.
1. Saves and loads are event-driven
Do not assume data is present on the line after RequestLoadFromSlot. A load finishes when OnLoadComplete(bool bSuccess) fires - gate screen transitions and "loaded" UI on that delegate, not on the call returning.
2. Bind the error delegates
OnSaveError and OnLoadError fire once per fragment that fails, reporting the slot and fragment name. The operation continues for the other fragments - one bad fragment does not abort the rest.
On Event BeginPlay (or Event Construct in a widget): Get Crimson Save Game Manager -> three bind nodes off that same manager pin - Bind Event to On Save Error, Bind Event to On Load Error, and Bind Event to On Load Complete. Drag from each red Event pin and choose Add Custom Event to create its handler.
The two error handlers each receive Slot Name and Fragment Name strings - print Fragment Name in your toast so the player, and your logs, learn which system failed rather than just that the save broke. The load-complete handler receives a bSuccess bool: Branch on it and offer a retry on the false path. Both error delegates fire once per failing fragment, so a handler can run several times in one operation.
.sav in Saved/SaveGames/), then load the slot - OnLoadError fires for that fragment while the others still load, and OnLoadComplete reports bSuccess = false.FragmentName) rather than blocking the whole load, so a single corrupt fragment doesn't strand the player.See also
- How-To: Build a Save/Load Menu
- API Reference -> Save Manager Subsystem -> Delegates