mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Ignored posthog-js and ember-concurrency cancellation errors in Sentry (#20383)
fixes https://linear.app/tryghost/issue/SLO-126 fixes https://linear.app/tryghost/issue/SLO-141 fixes https://linear.app/tryghost/issue/SLO-150 - during a session, posthog-js' rrweb extension can start throwing a lot of errors. These errors do not affect the application - similarly, ember-concurrency's task cancellation errors do not affect the application. Task in ember-concurrency are expected to be canceled. However, if they're cast to a Promise, they show up as unhandled Promise rejections as Promises do not have a concept of cancellation
This commit is contained in:
parent
ebda61ad42
commit
66f7911d24
@ -190,7 +190,12 @@ export default Route.extend(ShortcutsRoute, {
|
||||
/^TransitionAborted$/,
|
||||
// ResizeObserver loop errors occur often from extensions and
|
||||
// embedded content, generally harmless and not useful to report
|
||||
/^ResizeObserver loop completed with undelivered notifications/
|
||||
/^ResizeObserver loop completed with undelivered notifications/,
|
||||
/^ResizeObserver loop limit exceeded/,
|
||||
// When tasks in ember-concurrency are canceled, they sometimes lead to unhandled Promise rejections
|
||||
// This doesn't affect the application and is not useful to report
|
||||
// - http://ember-concurrency.com/docs/cancelation
|
||||
'TaskCancelation'
|
||||
],
|
||||
integrations: []
|
||||
};
|
||||
|
@ -34,10 +34,17 @@ export function beforeSend(event, hint) {
|
||||
delete event.tags.ajax_url;
|
||||
}
|
||||
|
||||
// Do not report poshog-js errors to Sentry
|
||||
if (hint && hint.originalException && hint.originalException.stack) {
|
||||
if (hint.originalException.stack.includes('/posthog-js/')) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return event;
|
||||
} catch (error) {
|
||||
// If any errors occur in beforeSend, send the original event to Sentry
|
||||
// Better to have some information than no information
|
||||
return event;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user