Skip to content

Add error boundary page (#81) - #173

Merged
geetxnshgoyal merged 2 commits into
NST-DEVFORGE:mainfrom
drathava847-beep:fix/81-error-boundary
Oct 3, 2026
Merged

geetxnshgoyal merged 2 commits into
NST-DEVFORGE:mainfrom
drathava847-beep:fix/81-error-boundary

Conversation

@drathava847-beep

Copy link
Copy Markdown
Contributor

Fixes #81

Summary

  • Added app/error.tsx as a client error boundary.
  • Added a calm error message and a Try again button using reset().
  • Logged errors with console.error without displaying the raw error message.

Testing

  • npm run lint
  • npm test
  • npm run build
  • Temporarily threw an error locally to verify the error boundary, then removed the temporary error.

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@drathava847-beep is attempting to deploy a commit to the Geetansh Goyal's projects Team on Vercel.

A member of the Team first needs to authorize it.

github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

📸 How this looks

Built from this PR, so you can see the change without checking it out.

/

Desktop (1280px), top 3000px
Mobile (390px), top 3000px

/learn/open-source

Desktop (1280px), top 3000px
Mobile (390px), top 3000px

Screenshots are taken from a production build of this PR, signed out. Pages behind sign-in show the signed-out view. Build log

@nishtha-agarwal-211 nishtha-agarwal-211 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! The logic and error boundary setup look solid, but please update the styling before merge:

  • Missing Tailwind classes: bg-primary, text-primary-foreground, and text-muted-foreground are not configured in this repo, so the retry button and text render completely unstyled.
  • Theme alignment: Please match the styling used in app/not-found.tsx (e.g. text-neutral-400 for muted text and the cyan accent styles for the button).
  • UX suggestion: Consider adding a secondary link back to Home (/) so users aren't stuck if re-trying fails.

github-actions Bot added a commit that referenced this pull request Sep 30, 2026

@dhhhhruv dhhhhruv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me

@geetxnshgoyal
geetxnshgoyal merged commit 619c3a3 into NST-DEVFORGE:main Oct 3, 2026
5 of 6 checks passed
github-actions Bot added a commit that referenced this pull request Oct 3, 2026
@prachidarshi-2307

Copy link
Copy Markdown

I checked out this branch locally and ran the development build (npm run dev) to test the error boundary behavior.

Overall, the client-side error boundary setup in app/error.tsx is clean and correctly implements Next.js reset() handling. I have left one specific actionable suggestion regarding theme tokens/fallback navigation and a question below:

Question:

In Next.js App Router, does app/error.tsx catch errors thrown inside the root app/layout.tsx, or do we need a separate app/global-error.tsx for root layout crashes? Is handling root layout errors planned for a follow-up PR?

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.

Add an error boundary page (app/error.tsx)

5 participants