mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 10:03:06 +01:00
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:
@@ -188,9 +188,11 @@ func handleMsgMhfEnumerateOrder(s *Session, p mhfpacket.MHFPacket) {
|
||||
func handleMsgMhfGetExtraInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func userGetItems(s *Session) []mhfitem.MHFItemStack {
|
||||
var data []byte
|
||||
var items []mhfitem.MHFItemStack
|
||||
data, _ = s.server.userRepo.GetItemBox(s.userID)
|
||||
data, err := s.server.userRepo.GetItemBox(s.userID)
|
||||
if err != nil {
|
||||
s.logger.Warn("Failed to load user item box", zap.Error(err))
|
||||
}
|
||||
if len(data) > 0 {
|
||||
box := byteframe.NewByteFrameFromBytes(data)
|
||||
numStacks := box.ReadUint16()
|
||||
@@ -247,7 +249,10 @@ func handleMsgMhfCheckWeeklyStamp(s *Session, p mhfpacket.MHFPacket) {
|
||||
updated = 1
|
||||
}
|
||||
|
||||
total, redeemed, _ = s.server.stampRepo.GetTotals(s.charID, pkt.StampType)
|
||||
total, redeemed, err = s.server.stampRepo.GetTotals(s.charID, pkt.StampType)
|
||||
if err != nil {
|
||||
s.logger.Warn("Failed to get stamp totals", zap.Error(err))
|
||||
}
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(total)
|
||||
bf.WriteUint16(redeemed)
|
||||
|
||||
Reference in New Issue
Block a user