fix(editor): Don't report certain error types to Sentry (no-changelog) (#11090)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-10-04 11:32:20 +02:00 committed by GitHub
parent 90e6d3384c
commit e5c7215bca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);