Put in order · Next.js course · Module 2: Routing and Layouts
Error Handling in error.js
Arrange the order of handling an error with the error.js file
Items to put in order
- Clicking the button with reset() renders the segment again
- The nearest error boundary from error.js catches the error
- The page component throws an error while rendering
- Next.js shows the error.js component instead of the segment
Show the answer
Correct order:
- The page component throws an error while rendering
- The nearest error boundary from error.js catches the error
- Next.js shows the error.js component instead of the segment
- Clicking the button with reset() renders the segment again