mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-28 10:32:55 +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:
@@ -59,7 +59,11 @@ func handleMsgMhfUpdateGuildMessageBoard(s *Session, p mhfpacket.MHFPacket) {
|
||||
guild, err := s.server.guildRepo.GetByCharID(s.charID)
|
||||
applicant := false
|
||||
if guild != nil {
|
||||
applicant, _ = s.server.guildRepo.HasApplication(guild.ID, s.charID)
|
||||
var appErr error
|
||||
applicant, appErr = s.server.guildRepo.HasApplication(guild.ID, s.charID)
|
||||
if appErr != nil {
|
||||
s.logger.Warn("Failed to check guild application status", zap.Error(appErr))
|
||||
}
|
||||
}
|
||||
if err != nil || guild == nil || applicant {
|
||||
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
|
||||
Reference in New Issue
Block a user