-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(nextjs): Add comprehensive error capturing documentation #15936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Create dedicated capturing-errors page for Next.js with SplitLayout - Cover error boundaries, Server Actions, API routes, middleware - Add best practices and troubleshooting sections - Exclude common usage page from Next.js (uses dedicated page) - Add redirect from /usage to /capturing-errors Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| ### Route Handlers | ||
|
|
||
| Errors in API Route Handlers are automatically captured. For custom error responses, catch and report manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we trying to demonstrate how to extend this functionality with another example of where to use captureException?
I'm noticing you aren't adding more information for unhandled exceptions in client-side code, or unhandled promise rejections from the list of things Sentry automatically captures.
If you do want to keep this section, I think it needs a bit more reasoning around why you're bringing it up.
| </SplitSection> | ||
| </SplitLayout> | ||
|
|
||
| ## Manual Capture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this section different from the others? It seems like this whole guide is about manual capture?
| </SplitSection> | ||
| </SplitLayout> | ||
|
|
||
| ## Best Practices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, but it also feels a little repetitive. I wonder if this just gets added to the sections where you already talk about these things - for example global settings vs at a path level?
Otherwise, this might be better as a TL;DR, instead of having more examples? Only because it elongates the page an awful lot. I love me some best practices though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have this conviction that docs are more and more consumed by LLMs. And not so much in a way that is copy ai rules to an llm but literally copy and paste the url to an agent. we do the conversion to markdown already, and this structure imo gives the LLMs a better chance of parsing and setting things up properly.
I could be completely wrong tho, definitely open to more feedback, cause yeah, i do understand that it extends the page in length, but for LLMs its a good thing (i think?lol) and for devs we have the sidebar with sections to skim and jump to the right part, if they are on this page, the assumption is they are here for a reason, and have it be a manual with more context than less.
Just an opinion though, absolutely not set in stone
sfanahata
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meta comment: This is really good! I think we could do something similar to clean up the inherited common version of this page too, to streamline in some ways.
I think we could be a bit more precise with when and why we're talking about using certain functions/options in order to further streamline this page.
Summary
/capturing-errorspage for Next.js with SplitLayout pattern/usage→/capturing-errorsTest plan
/platforms/javascript/guides/nextjs/capturing-errors//platforms/javascript/guides/nextjs/usage/🤖 Generated with Claude Code