From e5c7215bcabfe2847d6b785448d8fc9ad0904baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 4 Oct 2024 11:32:20 +0200 Subject: [PATCH] fix(editor): Don't report certain error types to Sentry (no-changelog) (#11090) --- packages/editor-ui/src/main.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/main.ts b/packages/editor-ui/src/main.ts index 30721aa209..d5ee658d51 100644 --- a/packages/editor-ui/src/main.ts +++ b/packages/editor-ui/src/main.ts @@ -30,6 +30,7 @@ import { FontAwesomePlugin } from './plugins/icons'; import { createPinia, PiniaVuePlugin } from 'pinia'; import { JsPlumbPlugin } from '@/plugins/jsplumb'; import { ChartJSPlugin } from '@/plugins/chartjs'; +import { AxiosError } from 'axios'; const pinia = createPinia(); @@ -37,7 +38,22 @@ const app = createApp(App); if (window.sentry?.dsn) { const { dsn, release, environment } = window.sentry; - Sentry.init({ app, dsn, release, environment }); + Sentry.init({ + app, + dsn, + release, + environment, + beforeSend(event, { originalException }) { + if ( + !originalException || + originalException instanceof AxiosError || + (originalException instanceof Error && originalException.message.includes('ResizeObserver')) + ) { + return null; + } + return event; + }, + }); } app.use(TelemetryPlugin);