Skip to content

fix(wallets): show 404 page when wallet id does not exist - #1836

Open
yasiru98 wants to merge 1 commit into
Greenstand:mainfrom
yasiru98:fix/1546-wallet-404-error
Open

yasiru98 wants to merge 1 commit into
Greenstand:mainfrom
yasiru98:fix/1546-wallet-404-error

Conversation

@yasiru98

@yasiru98 yasiru98 commented Aug 28, 2026 •

Copy link
Copy Markdown

Description

Visiting a wallet URL with a non-existent wallet ID was showing a 500 error page instead of a 404.

Debugging: Confirmed via direct API call that the backend returns HTTP 404 for non-existent wallet IDs. The existing wrapper utility in utils.js already converts e.response?.status === 404 to { notFound: true } for Next.js. However, the 404 error from getWalletById was not reliably reaching the wrapper with its response property intact.

Fix: Added an explicit try-catch in serverSideData that catches only HTTP 404 errors from getWalletById and re-throws them cleanly so the wrapper receives a properly structured error and returns { notFound: true }. All other errors (real server errors, network failures) are re-thrown unchanged so they continue to be handled as transient failures.

Fixes #1546

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Before After
1 2

How Has This Been Tested?

Manually tested on local dev server and confirmed the 404 page renders correctly instead of a 500 error.

Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings

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.

Display 500 error page inappropriate.

1 participant