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:
@@ -402,12 +402,14 @@ func addWarehouseItem(s *Session, item mhfitem.MHFItemStack) {
|
||||
|
||||
func warehouseGetItems(s *Session, index uint8) []mhfitem.MHFItemStack {
|
||||
initializeWarehouse(s)
|
||||
var data []byte
|
||||
var items []mhfitem.MHFItemStack
|
||||
if index > 10 {
|
||||
return items
|
||||
}
|
||||
data, _ = s.server.houseRepo.GetWarehouseItemData(s.charID, index)
|
||||
data, err := s.server.houseRepo.GetWarehouseItemData(s.charID, index)
|
||||
if err != nil {
|
||||
s.logger.Warn("Failed to load warehouse item data", zap.Error(err))
|
||||
}
|
||||
if len(data) > 0 {
|
||||
box := byteframe.NewByteFrameFromBytes(data)
|
||||
numStacks := box.ReadUint16()
|
||||
@@ -420,12 +422,14 @@ func warehouseGetItems(s *Session, index uint8) []mhfitem.MHFItemStack {
|
||||
}
|
||||
|
||||
func warehouseGetEquipment(s *Session, index uint8) []mhfitem.MHFEquipment {
|
||||
var data []byte
|
||||
var equipment []mhfitem.MHFEquipment
|
||||
if index > 10 {
|
||||
return equipment
|
||||
}
|
||||
data, _ = s.server.houseRepo.GetWarehouseEquipData(s.charID, index)
|
||||
data, err := s.server.houseRepo.GetWarehouseEquipData(s.charID, index)
|
||||
if err != nil {
|
||||
s.logger.Warn("Failed to load warehouse equipment data", zap.Error(err))
|
||||
}
|
||||
if len(data) > 0 {
|
||||
box := byteframe.NewByteFrameFromBytes(data)
|
||||
numStacks := box.ReadUint16()
|
||||
|
||||
Reference in New Issue
Block a user