Error Boundaries in the App Router
An error.tsx file wraps its segment in a React error boundary that catches render-time errors below it and receives the error plus a reset() function to retry the segment; errors bubble to the nearest boundary above, and global-error.tsx catches failures in the root layout itself. not-found.tsx handles the notFound() control-flow case separately.
This Concept is waiting for its first lesson!
An error.tsx file wraps its segment in a React error boundary that catches render-time errors below it and receives the error plus a reset() function to retry the segment; errors bubble to the nearest boundary above, and global-error.tsx catches failures in the root layout itself. not-found.tsx handles the notFound() control-flow case separately.
Are you a teacher? Sign in to start contributing.
Sign In