mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
Format stats error (#10681)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user