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 boundaries WD-8089 #595

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

edlerd
Copy link
Collaborator

@edlerd edlerd commented Jan 5, 2024

Done

  • add error boundary component
  • apply error boundary to 1) main content and 2) the whole app

Fixes: WD-8089

QA

  1. Run the LXD-UI:
    • On the demo server via the link posted by @webteam-app below. This is only available for PRs created by collaborators of the repo. Ask @lorumic or @edlerd for access.
    • With a local copy of this branch, run as described here.
  2. Perform the following QA steps:
    • force an error in a nested component and ensure the boundary works (i.e. add throw new Error("foo"); to InstanceList.tsx

Screenshot

Error in a content component:
image

Error in navigation or a component higher in the component tree:
image

@webteam-app
Copy link

Demo starting at https://lxd-ui-595.demos.haus

@edlerd edlerd force-pushed the add-error-boundaries branch 2 times, most recently from ad397c3 to cd5606b Compare January 5, 2024 11:00
@edlerd edlerd changed the title Add error boundaries Add error boundaries WD-8089 Jan 5, 2024
@mas-who
Copy link
Collaborator

mas-who commented Jan 5, 2024

QA looks good (locally forcing an error)! Perhaps we can pass the actual error component as a fallback prop to the ErrorBoundary to make it slightly more generalised?

Signed-off-by: David Edler <david.edler@canonical.com>
@edlerd
Copy link
Collaborator Author

edlerd commented Jan 5, 2024

Split out the ErrorPage component and added a fallback prop to the ErrorBoundry

@mas-who
Copy link
Collaborator

mas-who commented Jan 5, 2024

LGTM. We should wait for @piperdeck to give some design input

@piperdeck
Copy link

Looks good to me!

@edlerd edlerd merged commit 16ad1db into canonical:main Jan 5, 2024
6 checks passed
@edlerd edlerd deleted the add-error-boundaries branch January 5, 2024 14:32
github-actions bot pushed a commit that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants