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

Render error message in UI when uncaught exception happens #1320

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

mvandenburgh
Copy link
Member

@mvandenburgh mvandenburgh commented Oct 11, 2022

Adds a global error handler that renders a snackbar error message whenever an uncaught exception occurs.

Closes #768.

dandi-error-handler

Copy link
Member

@waxlamp waxlamp left a comment

Choose a reason for hiding this comment

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

This is an elegant solution. Nice work!

The only other idea I have is to set the timeout to -1 (so that the snackbar doesn't auto-dismiss), and include a "close" button (like the example in the v-snackbar documentation). The rationale is to alert a user to an error when they're not paying attention (e.g., they flip to a different tab and come back 10 seconds later, or get up from their computer, etc.)

I don't want that to hold up this PR, though it should be an easy fix if you decide to include it.

web/src/App.vue Outdated Show resolved Hide resolved
@yarikoptic
Copy link
Member

looks good to me, thank you @mvandenburgh !
Is there a dandiset on staging so I could go to https://deploy-preview-1320--gui-staging-dandiarchive-org.netlify.app/dandiset and enjoy it ? webshot demonstration seems to be on 000362 but I can't find it there

@mvandenburgh
Copy link
Member Author

looks good to me, thank you @mvandenburgh ! Is there a dandiset on staging so I could go to deploy-preview-1320--gui-staging-dandiarchive-org.netlify.app/dandiset and enjoy it ? webshot demonstration seems to be on 000362 but I can't find it there

That was taken on my local development environment, where I intentionally introduced an error to trigger the alert. But, you can go to https://deploy-preview-1320--gui-staging-dandiarchive-org.netlify.app/dandiset/search?search=test&page=7&sortOption=0&sortDir=-1&showDrafts=true&showEmpty=false to see it in action (that links to some search results with an invalid page number, which currently results in an exception and is another bug on my list to fix)

@mvandenburgh mvandenburgh merged commit 89afedd into master Oct 11, 2022
@mvandenburgh mvandenburgh deleted the display-message-on-error branch October 11, 2022 21:24
@dandibot
Copy link
Member

dandibot commented Nov 7, 2022

🚀 PR was released in v0.3.0 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show error message when interaction with dandi-api results in error
4 participants