fix: ignore NEXT_NOT_FOUND error on sentry (#1837)

This commit is contained in:
Anshuman Pandey
2024-01-02 17:12:47 +05:30
committed by GitHub
parent 7f25bbc008
commit e0c17407e3
2 changed files with 20 additions and 0 deletions

View File

@@ -26,4 +26,14 @@ Sentry.init({
blockAllMedia: true,
}),
],
beforeSend(event, hint) {
const error = hint.originalException as Error;
// @ts-expect-error
if (error && error.digest === "NEXT_NOT_FOUND") {
return null;
}
return event;
},
});

View File

@@ -11,4 +11,14 @@ Sentry.init({
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
beforeSend(event, hint) {
const error = hint.originalException as Error;
// @ts-expect-error
if (error && error.digest === "NEXT_NOT_FOUND") {
return null;
}
return event;
},
});