Error keeps being reported despite exact matching text in `ignoreErrors` list
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
- Add
'Record not found'to theignoreErrorsoption array - Raise an error with
Record not foundin the message
Expected Result
Expect for this error to be ignored by Sentry
Actual Result
Error is recorded in Sentry:
Product Area
Processing
Link
https://arist.sentry.io/issues/6561825991/events/e38eb2019c3d4f43ac2f65b037ed17c1
DSN
https://[email protected]/4508656186163201
Version
No response
Auto-routing to @getsentry/product-owners-issues for triage ⏲️
Hi, @adamreisnz.
Sorry you're having trouble. The JS SDK folks would be the best ones to help you debug this, since ignoreErrors handling happens there, so I'm going to transfer this to their repo.
For whoever looks into this: The event linked above was captured with the Vue SDK, v9.9.0, with the InboundFilters integration running.
Hey, I have tried to reproduce this but it does seem to work for me to filter this error event 🤔 Could you share your full init() code?
Sentry.init({
app,
dsn,
release: gitHash.value,
environment: env.value,
integrations: [
Sentry.browserTracingIntegration({router}),
Sentry.thirdPartyErrorFilterIntegration({
filterKeys: ['xxxxxxxxxxx'],
behaviour: 'drop-error-if-exclusively-contains-third-party-frames',
}),
],
trackComponents: [
'App',
],
tracesSampleRate: 1.0,
tracePropagationTargets: [
domains.DEV,
domains.QA,
domains.STAGING,
domains.PRODUCTION,
],
ignoreErrors: [
//Specific network errors
'Failed to fetch', //Generic fetch failures
'Load failed', //iOS message for when fetch doesn't respond, likely a network issue
'NetworkError when attempting to fetch resource', //CORS or network error
'AbortError', //Occurs when a fetch request is aborted
`Unexpected token '<'`, //Occurs when server might be down during deploy and returns a HTML page instead of JSON
//Generic request/response errors
'Request timed out', //Server request timeouts
'Network error', //Generic network errors
'Bad gateway', //Occurs when a request is made during a deploy
'Internal server error', //Internal server errors (500)
'Server error', //Generic server errors
'Record not found', //Generic 404 errors
//Auth related
'Unauthenticated', //Unauthenticated errors
'Unauthorized', //Unauthorized errors
//other errors removed
],
})
Hmm, that seems correct. Is this still ongoing, though? Looking at the event you linked, this seemed to have happened the last time 3 days ago, was this already filtered at this time (or could it have been an outdated app version that lead to this)?
Yes, still ongoing.
As per the screenshots, you can see we added the filter for this error type 2 months ago, yet Sentry captured an event for it 2-3 days ago.
I'll go ahead and artificially trigger another event like it now as well to verify.
On Thu, 15 May 2025, 23:04 Francesco Gringl-Novy, @.***> wrote:
mydea left a comment (getsentry/sentry-javascript#16302) https://github.com/getsentry/sentry-javascript/issues/16302#issuecomment-2883425143
Hmm, that seems correct. Is this still ongoing, though? Looking at the event you linked, this seemed to have happened the last time 3 days ago, was this already filtered at this time (or could it have been an outdated app version that lead to this)?
— Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry-javascript/issues/16302#issuecomment-2883425143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXYQRLUVMCJA2KPK5DYVT26RYEXAVCNFSM6AAAAAB5EYRJN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBTGQZDKMJUGM . You are receiving this because you authored the thread.Message ID: @.***>
@adamreisnz Thanks for reporting this issue. Before we can determine if this is a bug in Sentry's ignoreErrors functionality, we need to understand the exact context where the error is occurring.
In Next.js, errors can be caught and reported to Sentry through different mechanisms:
-
API Routes:
- Direct throws (handled by Next.js error boundary)
- Try-catch with
Sentry.captureException - Next.js error handling middleware
-
Client Components:
- React Error Boundaries
- Try-catch blocks
- Unhandled promise rejections
-
Server Components:
- Next.js error handling
- Server-side error boundaries
-
Middleware:
- Next.js middleware error handling
- Custom error handling
Could you please provide:
- The exact location where the "Record not found" error is being thrown (API route, client component, etc.)?
- The code that's throwing the error?
- How you're capturing the error (direct throw, try-catch, etc.)?
This will help us determine if the error is bypassing Sentry's ignoreErrors check due to Next.js's error handling mechanisms, or if there's an actual issue with Sentry's error filtering.
For example, if you're throwing the error directly in an API route without try-catch:
// This bypasses Sentry's ignoreErrors
export async function GET() {
throw new Error('Record not found');
}
Versus catching and explicitly using Sentry:
// This should respect ignoreErrors
export async function GET() {
try {
throw new Error('Record not found');
} catch (error) {
Sentry.captureException(error);
return NextResponse.json({ error: 'Record not found' }, { status: 404 });
}
}
The first case might be caught by Next.js's error handling before Sentry's ignoreErrors check, while the second case should properly go through Sentry's error processing pipeline.
Could you share the relevant code so we can better understand the context and determine if this is a Sentry issue or a Next.js error handling consideration?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Hi team,
We don't use Next.js or React, but Vue. This was an error that we deliberately captured using Sentry.captureException (or rather, to be more precies, the code base has been set up that it automatically feeds into Sentry.captureException when we encounter an API error).
The relevant code:
//Process an error
const processError = error => {
//Ensure error in error processing doesn't trigger an error itself
try {
//No error? 🤨
if (!error) {
//Seems to originate from Sentry itself, according to this comment:
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
// means the sentry.javascript SDK caught an error invoking your application code. This
// is expected behavior and NOT indicative of a bug with sentry.javascript
Sentry.captureException(new Error('Error is empty'), {level: 'info'})
return
}
//Ensure error is an object
if (typeof error !== 'object') {
Sentry.captureException(new Error(`Error is not an object: ${error}`), {level: 'info'})
return
}
//Already processed?
if (error.isProcessed) {
return
}
//Log to console
console.error(error)
//Capture in Sentry
if (!error.ignoreInSentry) {
Sentry.captureException(error)
}
//Flag as processed
error.isProcessed = true
}
catch {
//Fall through
}
}
Did you try to trigger this error again? When doing this locally with debug: true, do you see any logs about sent/filtered errors?
I was able to reproduce this error in a Nuxt app (which is using Vue under the hood as well) when SSR was enabled. As the page was created on the server, the error message needed to be added to ignoreErrors in the server config as well to be filtered.
Do you have any sever rendering enabled in your Vue application? Can you share your application setup?
The interesting thing is, that beforeSend is not called for the error that should be filtered, but it gets sent to Sentry nevertheless. I haven't found the cause for this yet.
Hi, sorry for the late reply. We don't have the debug flag enabled, but if I have time I will try to reproduce locally (Sentry is generally disabled locally altogether).
SSR is not enabled in the Vue application.
Thank you, yeah it would be interesting what the debug logs say.
I haven't seen this one pop up lately, so I want to tentatively say this has either been fixed, or Sentry stopped linking (different) new issues to that same "Not found error" issue. Either way, I'll close this out for now and will keep an eye on it happening again, thank you!