Skip to content

Fix/404 detail not found errors#350

Closed
chuks68 wants to merge 3 commits into
AnchorNet-Org:mainfrom
chuks68:fix/404-detail-not-found-errors
Closed

Fix/404 detail not found errors#350
chuks68 wants to merge 3 commits into
AnchorNet-Org:mainfrom
chuks68:fix/404-detail-not-found-errors

Conversation

@chuks68

@chuks68 chuks68 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #131
This PR improves error-handling UX for missing resources in details panels. Previously, all asynchronous error states were rendered as flat red messages using state.message, which did not distinguish a 404 Not Found response from a 500 Server Error or a network failure.

Changes
src/hooks/useAsync.ts: Updated the custom hook to store and expose the original error object (state.error?: unknown) under the async state so components can inspect details beyond just the stringified message.
src/components/AnchorDetail.tsx: Checks if the async loader error is an ApiRequestError with status code 404 and displays a distinct "Anchor not found" message with a link back to /anchors instead of the generic red text.
src/components/SettlementDetail.tsx: Applies identical logic to render a distinct "Settlement not found" message with a link back to /settlements.
src/components/AnchorDetail.test.tsx: Added a mock unit test covering the 404 error branch for the anchor details loader.
src/components/SettlementDetail.test.tsx: Added a mock unit test covering the 404 error branch for the settlement details loader.

@chuks68
chuks68 force-pushed the fix/404-detail-not-found-errors branch from 5cd0d64 to 5bea467 Compare July 21, 2026 20:42
@Jagadeeshftw

Copy link
Copy Markdown
Contributor

Thanks — after resolving the merge, this ends up fully redundant with main: the PoolsPanel memoization and SettlementTable responsive card-layout content already landed via #349/#352, and the 404 detail-page messaging commit here matches what's already on main too. Zero net diff left, so closing as already covered rather than merging a duplicate.

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.

Distinguish a 404 from a generic failure when fetchAnchor errors in AnchorDetail

2 participants