mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
fix(channelserver): handle bare Exec errors and filter expected ErrNoRows
138 bare db.Exec calls across 22 handler files silently dropped write errors. Each is now wrapped with error check and zap logging. 4 QueryRow sites that legitimately return sql.ErrNoRows during normal operation (new player mezfes, festa rankings, empty guild item box) now filter it out to reduce log noise.
This commit is contained in:
@@ -78,7 +78,9 @@ func handleMsgMhfSavedata(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.rawConn.Close()
|
||||
s.logger.Warn("Save cancelled due to corruption.")
|
||||
if s.server.erupeConfig.DeleteOnSaveCorruption {
|
||||
_, _ = s.server.db.Exec("UPDATE characters SET deleted=true WHERE id=$1", s.charID)
|
||||
if _, err := s.server.db.Exec("UPDATE characters SET deleted=true WHERE id=$1", s.charID); err != nil {
|
||||
s.logger.Error("Failed to mark character as deleted", zap.Error(err))
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user