Moved error exclusion to correct place

- adding it to ignoreErrors is better than beforeSend because it's built
  for this purpose and we've just looking at the error message
This commit is contained in:
Daniel Lockyer 2024-06-26 12:37:46 +02:00 committed by Daniel Lockyer
parent dd39576de0
commit 019f417c7d
2 changed files with 3 additions and 5 deletions

View File

@ -185,6 +185,9 @@ export default Route.extend(ShortcutsRoute, {
release: `ghost@${this.config.version}`,
beforeSend,
ignoreErrors: [
// Browser autoplay policies
/The play() request was interrupted because video-only background media was paused to save power./,
// Network errors that we don't control
/Server was unreachable/,
/NetworkError when attempting to fetch resource./,

View File

@ -14,11 +14,6 @@ export function beforeSend(event, hint) {
return null;
}
// Ignore errors that are due to browser power saving settings
if (exception?.message?.includes('The play() request was interrupted because video-only background media was paused to save power.')) {
return null;
}
// if the error value includes a model id then overwrite it to improve grouping
if (event.exception && event.exception.values && event.exception.values.length > 0) {
const pattern = /<(post|page):[a-f0-9]+>/;