mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
fix(channelserver): return error from Save() to prevent misleading success logs
CharacterSaveData.Save() silently returned on failure (nil decompressed data, compression error, DB error) while the caller unconditionally logged "Saved character data successfully". This made diagnosing save failures difficult (ref #163). Save() now returns an error, and all six call sites check it. The success log in saveAllCharacterData only fires when the save actually persisted.
This commit is contained in:
@@ -476,7 +476,9 @@ func TestCharacterSaveData_Save_Integration(t *testing.T) {
|
||||
saveData.WeaponID = 1234
|
||||
|
||||
// Save it
|
||||
saveData.Save(s)
|
||||
if err := saveData.Save(s); err != nil {
|
||||
t.Fatalf("Save failed: %v", err)
|
||||
}
|
||||
|
||||
// Reload and verify
|
||||
var hr, gr uint16
|
||||
|
||||
Reference in New Issue
Block a user