Format stats error (#10681)

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2026-03-25 09:36:44 +07:00
committed by GitHub
parent 4bad9689a3
commit 801c60b8ce
+10 -2
View File
@@ -103,8 +103,16 @@ export function initStatisticsContext (
const handleError = (err: any): void => {
errorToSend++
if (errorToSend % 2 === 0) {
if (err.code !== 'UND_ERR_SOCKET') {
console.error(err)
const code = err?.code ?? err?.cause?.code
if (code !== 'UND_ERR_SOCKET') {
metricsContext.warn('Failed to send statistics', {
service: serviceName,
statsUrl,
code,
message: err?.message,
causeMessage: err?.cause?.message,
err
})
}
}
prev = undefined