fix(channelserver): add error logging to silently ignored repo calls

19 repository calls across 8 handler files were silently discarding
errors with `_ =`, making database failures invisible. Add structured
logging at appropriate levels: Error for write operations where data
loss may occur (guild saves, member updates), Warn for read operations
where handlers continue with zero-value defaults (application checks,
warehouse loads, item box queries). No control flow changes.
This commit is contained in:
Houmgaor
2026-02-21 17:37:29 +01:00
parent 6fbd294575
commit 8fe6f60813
8 changed files with 72 additions and 23 deletions

View File

@@ -212,7 +212,11 @@ func handleMsgMhfReadMercenaryW(s *Session, p mhfpacket.MHFPacket) {
var cid uint32
var name string
if pactID > 0 {
cid, name, _ = s.server.charRepo.FindByRastaID(pactID)
var findErr error
cid, name, findErr = s.server.charRepo.FindByRastaID(pactID)
if findErr != nil {
s.logger.Warn("Failed to find character by rasta ID", zap.Error(findErr))
}
bf.WriteUint8(1) // numLends
bf.WriteUint32(uint32(pactID))
bf.WriteUint32(cid)