Skip to content

fix(nextjs): Don't capture forbidden() and unauthorized() as errors - #25088

Open
chargome wants to merge 1 commit into
developfrom
nextjs-auth-error-filter
Open

chargome wants to merge 1 commit into
developfrom
nextjs-auth-error-filter

Conversation

@chargome

@chargome chargome commented Oct 6, 2026

Copy link
Copy Markdown
Member

Next.js 16.4 canary drops the authInterrupts flag, so forbidden()/unauthorized() throws (NEXT_HTTP_ERROR_FALLBACK;403/;401) now need to be treated as control flow like notFound().

Next.js 16.4 canary removes the experimental authInterrupts gate, so these
throws reach our wrappers by default. Treat their NEXT_HTTP_ERROR_FALLBACK;403
and ;401 digests as control flow and set the matching span status instead of
reporting them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chargome chargome self-assigned this Oct 6, 2026
@chargome

chargome commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 22510f3. Configure here.

@chargome
chargome marked this pull request as ready for review October 6, 2026 11:23
@chargome
chargome requested a review from a team as a code owner October 6, 2026 11:23
@chargome
chargome requested review from nicohrubec and s1gr1d and removed request for a team October 6, 2026 11:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant