From 0b1edf40bac9e1cd3910b5495c6645fc1376f2aa Mon Sep 17 00:00:00 2001 From: dimmur-brw Date: Thu, 19 Mar 2026 15:02:35 +0100 Subject: [PATCH] Filter out unactionable AxiosErrors from sentry (#5010) --- ..._filter_out_unactionable_axioserrors_from_sentry.json | 9 +++++++++ web-frontend/sentry.client.config.ts | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 changelog/entries/unreleased/refactor/5008_filter_out_unactionable_axioserrors_from_sentry.json diff --git a/changelog/entries/unreleased/refactor/5008_filter_out_unactionable_axioserrors_from_sentry.json b/changelog/entries/unreleased/refactor/5008_filter_out_unactionable_axioserrors_from_sentry.json new file mode 100644 index 0000000000..f920787f78 --- /dev/null +++ b/changelog/entries/unreleased/refactor/5008_filter_out_unactionable_axioserrors_from_sentry.json @@ -0,0 +1,9 @@ +{ + "type": "refactor", + "message": "Filter out unactionable AxiosErrors from sentry", + "issue_origin": "github", + "issue_number": 5008, + "domain": "database", + "bullet_points": [], + "created_at": "2026-03-19" +} \ No newline at end of file diff --git a/web-frontend/sentry.client.config.ts b/web-frontend/sentry.client.config.ts index 5ba99ae665..853e39b691 100644 --- a/web-frontend/sentry.client.config.ts +++ b/web-frontend/sentry.client.config.ts @@ -31,6 +31,13 @@ if (dsn && dsn !== '') { beforeSend(event, hint) { const err = hint?.originalException if (err?.fatal === false || err?.response?.status === 401) return null + + // Filter out axios errors without a response like + // network error, timeout, aborted, cancelled requests + if (err?.name === 'AxiosError' && !err?.response) { + return null + } + if (isDev) { console.error('[Sentry captured error]', `${err}`) return null