mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 00:23:59 -07:00
Really ignore ResizeObserver loop errors
[common]
This commit is contained in:
parent
c3c8cb4660
commit
99a7540fe4
1 changed files with 22 additions and 3 deletions
|
@ -3,14 +3,26 @@ import * as Integrations from '@sentry/integrations';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import parseUrl from 'Utilities/String/parseUrl';
|
import parseUrl from 'Utilities/String/parseUrl';
|
||||||
|
|
||||||
|
const IgnoreErrors = [
|
||||||
|
// Innocuous browser errors
|
||||||
|
/ResizeObserver loop limit exceeded/,
|
||||||
|
/ResizeObserver loop completed with undelivered notifications/
|
||||||
|
];
|
||||||
|
|
||||||
function cleanseUrl(url) {
|
function cleanseUrl(url) {
|
||||||
const properties = parseUrl(url);
|
const properties = parseUrl(url);
|
||||||
|
|
||||||
return `${properties.pathname}${properties.search}`;
|
return `${properties.pathname}${properties.search}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanseData(data) {
|
function shouldIgnoreException(s) {
|
||||||
const result = _.cloneDeep(data);
|
return s && IgnoreErrors.find((pattern) => pattern.test(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanseData(event, hint) {
|
||||||
|
const result = _.cloneDeep(event);
|
||||||
|
|
||||||
|
const error = hint && hint.originalException;
|
||||||
|
|
||||||
result.transaction = cleanseUrl(result.transaction);
|
result.transaction = cleanseUrl(result.transaction);
|
||||||
|
|
||||||
|
@ -26,6 +38,14 @@ function cleanseData(data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
error &&
|
||||||
|
error.message &&
|
||||||
|
shouldIgnoreException(error.message)
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
result.request.url = cleanseUrl(result.request.url);
|
result.request.url = cleanseUrl(result.request.url);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -88,7 +108,6 @@ export default function createSentryMiddleware() {
|
||||||
environment: branch,
|
environment: branch,
|
||||||
release,
|
release,
|
||||||
sendDefaultPii: true,
|
sendDefaultPii: true,
|
||||||
ignoreErrors: ['ResizeObserver loop limit exceeded'],
|
|
||||||
beforeSend: cleanseData,
|
beforeSend: cleanseData,
|
||||||
integrations: [
|
integrations: [
|
||||||
new Integrations.RewriteFrames({ iteratee: stripUrlBase }),
|
new Integrations.RewriteFrames({ iteratee: stripUrlBase }),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue