fix: classify database outages and restore real HTTP fault checks

This commit is contained in:
Vladislav Agapov
2026-10-16 10:19:46 +03:00
parent b90581f613
commit 87e1e5d94b
25 changed files with 449 additions and 16 deletions
+3 -3
View File
@@ -43,16 +43,16 @@ func (s *Store) Chats(ctx context.Context, userID uuid.UUID, position dto.Positi
"user": userID, "time": position.CreatedAt, "id": position.ID, "limit": limit,
})
if err != nil {
return nil, err
return nil, normalize(err)
}
defer rows.Close()
chats := make([]dto.ChatDTO, 0)
for rows.Next() {
var chat dto.ChatDTO
if err := rows.Scan(&chat.ID, &chat.Title, &chat.CreatedAt, &chat.MemberIDs); err != nil {
return nil, err
return nil, normalize(err)
}
chats = append(chats, chat)
}
return chats, rows.Err()
return chats, normalize(rows.Err())
}