Skip to content

Commit 0b6badf

Browse files
committed
fix 404 handling in Sentry
1 parent 241f204 commit 0b6badf

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/website-router/src/routing.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ async function handleErrorResponse(options: {
4646
});
4747
}
4848

49-
options.sentry.captureException(
50-
new Error(` ${options.response.status}: ${requestedEndpoint} `),
51-
);
52-
5349
// return original response if it isnt a 404, will help with
5450
// debugging especially if Cloudflare is blocking the request
5551
if (options.response.status !== 404) {
52+
// we don't want to report 404
53+
options.sentry.captureException(
54+
new Error(` ${options.response.status}: ${requestedEndpoint} `),
55+
);
56+
5657
return options.response;
5758
}
5859

0 commit comments

Comments
 (0)