-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ask users to report errors if Playground load fails (#1686)
## Motivation for the change, related issues If Playground fails to load for a reason other than unsupported or unapproved storage access, the error message does not tell the user where they can report their issue. This PR simply adds an "If the problem persists, please report an issue on GitHub" line with a link to create a new Playground issue. Fixes #1683 ## Implementation details This PR contains some code reorganization because the previous code created a `<div>` and a `<button>` and reused them for various purposes. There was an initial bit of element creation code that configured the elements for the default case, and other cases overrode those defaults. And in some cases we wanted to change the order of the button and/or add messages. That made it easy to break or get something wrong even though adding a new message was such a small change. So I just changed each branch to create its own elements instead of reusing. Now the logic is separated like: ```js if (e?.name === 'NotSupportedError') { document.body.append(await renderStorageErrorUI()); } else { document.body.append(renderGenericErrorUI(e)); } ``` ## Testing I tested manually by throwing errors in the various `try` blocks.
- Loading branch information
1 parent
153e5ab
commit 4cbd5ac
Showing
1 changed file
with
114 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters