Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically throw on 5xx error responses #1493

Merged
merged 3 commits into from
Aug 9, 2024
Merged

Automatically throw on 5xx error responses #1493

merged 3 commits into from
Aug 9, 2024

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Aug 8, 2024

These are currently throwing {"msg":"storage error: can't scan into dest[5]: cannot scan NULL into *string"}
https://explorer.dev.oasis.io/testnet/sapphire/address/oasis1qp66ryj9caek77kewkxxvjvkzypljhsdgvm5q34d
https://explorer.dev.oasis.io/search?q=8d5a30f1e586dce3ae7839c5f20c846d6d71b27d185adbacd32778d6c60f55eb
but frontend is ignoring the error

Before After
explorer dev oasis io_testnet_sapphire_address_oasis1qp66ryj9caek77kewkxxvjvkzypljhsdgvm5q34d localhost_1234_testnet_sapphire_address_oasis1qp66ryj9caek77kewkxxvjvkzypljhsdgvm5q34d
explorer dev oasis io_search_q=8d5a30f1e586dce3ae7839c5f20c846d6d71b27d185adbacd32778d6c60f55eb localhost_1234_search_q=8d5a30f1e586dce3ae7839c5f20c846d6d71b27d185adbacd32778d6c60f55eb

Copy link

github-actions bot commented Aug 8, 2024

Deployed to Cloudflare Pages

Latest commit: 92c9bcebfb6478d791962efc6ef7bedbca6091e8
Status:✅ Deploy successful!
Preview URL: https://c2a3dcd0.oasis-explorer.pages.dev

src/app/data/oasis-account-names.ts Outdated Show resolved Hide resolved
useErrorBoundary: (error: any) => {
// Automatically throw on 5xx errors. Components that want to handle
// errors should set `useErrorBoundary: false` in their queries.
return error.response?.status >= 500
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we sure that every query is covered? In a sense, I see status queries are disabled, which we don't want to crash the app. But could for example one query on account page "crash" the page to show the error boundary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah some 5xx failures could hit page-level error boundary

@lukaw3d lukaw3d merged commit 331aed6 into master Aug 9, 2024
8 checks passed
@lukaw3d lukaw3d deleted the lw/throw-5xx branch August 9, 2024 19:08
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.

2 participants