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

Add Error Boundary and Server-Side API Calls for Recent Bookmarks Sidebar #1097

Closed
John-Paul-Larkin opened this issue Oct 9, 2024 · 11 comments

Comments

@John-Paul-Larkin
Copy link
Member

Context

The Recent Bookmarks sidebar currently crashes the entire page if the API call fails. We need to improve the error handling so that the entire page is not affected by an API failure related to this component.

Expected Behavior

  • Add an error boundary specifically around the SideBarSavedPosts component to handle failures gracefully.
  • Ensure error handling applies to individual pieces of the component, so it does not affect the rest of the page.

Screenshots

Home page with recent bookmarks

@HarshitT00
Copy link
Contributor

Want to work on this one

@John-Paul-Larkin
Copy link
Member Author

@HarshitT00
Awesome, I assigned you.

@HarshitT00
Copy link
Contributor

How to reproduce the error?

@John-Paul-Larkin
Copy link
Member Author

@HarshitT00
You can throw your own error.
The issue is to create an error boundary, so that it will be caught in the event of an error.

@HarshitT00
Copy link
Contributor

HarshitT00 commented Oct 9, 2024

@John-Paul-Larkin

image

myBookmarks: protectedProcedure.query(async ({ ctx }) => {
throw new Error("something wrong")

should do anything else to reproduce error

Copy link

github-actions bot commented Oct 9, 2024

Uh oh! @HarshitT00, the image you shared is missing helpful alt text. Check #1097 (comment).

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

1 similar comment
Copy link

github-actions bot commented Oct 9, 2024

Uh oh! @HarshitT00, the image you shared is missing helpful alt text. Check #1097 (comment).

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@John-Paul-Larkin
Copy link
Member Author

@HarshitT00
Hm... that seems to be handled so, but please wait until @NiallJoeMaher has a look at this.

@HarshitT00
Copy link
Contributor

Yes, But I have made some changes in code to handle current situation in better way. If you want I can raise a PR

@John-Paul-Larkin
Copy link
Member Author

Even better, thanks. Please put a WIP tag on the PR until Niall reviews this issue.

@NiallJoeMaher
Copy link
Contributor

@HarshitT00 I left a comment. I think we don't need all the changes but some of them are great. I'll close this issue but you can see the comment in your PR. If you fix up based on my comment I'll merge it (and get you some of those sweet Hacktoberfest points).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants