Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

fix: handle backend errors in pool page #1031

Merged
merged 13 commits into from
Sep 13, 2024
Merged

fix: handle backend errors in pool page #1031

merged 13 commits into from
Sep 13, 2024

Conversation

agualis
Copy link
Contributor

@agualis agualis commented Aug 29, 2024

Before this fix any backend error in a pool query would crash the app and send an error to sentry.

Screenshot 2024-08-29 at 17 07 10

After this fix:

  • We detect invalid pool id error.
  • We capture other errors in sentry
  • We show an alert instead of crashing the app:
error

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 2:07pm
test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 2:07pm

Copy link
Contributor

@garethfuller garethfuller left a comment

Choose a reason for hiding this comment

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

@agualis I'm struggling to get this to work how I wanted with Error boundaries. It works in dev, but in production it blocks you from rendering error messages that are thrown in server components for security reasons, which makes sense.

I need to move on to something else for now, maybe you could take another look. Maybe you were right to start with by just rendering an error message on the RSC.

@garethfuller garethfuller merged commit 46df735 into main Sep 13, 2024
7 checks passed
@garethfuller garethfuller deleted the fix/poolNotFound branch September 13, 2024 14:41
agualis added a commit that referenced this pull request Sep 16, 2024
* fix: pool page error when pool id is not found

* fix: avoid alert var

* fix: capture pool query backend errors in sentry

* Update app/(app)/pools/[chain]/[variant]/[id]/layout.tsx

Co-authored-by: Gareth Fuller <[email protected]>

* Update app/(app)/pools/[chain]/[variant]/[id]/layout.tsx

Co-authored-by: Gareth Fuller <[email protected]>

* chore: Use error boundaries

* chore: Minor updates

* chore: Remove

* chore: Handle errors better

* chore: Update container height

* fix: Await header

---------

Co-authored-by: Gareth Fuller <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants