8000 fix(site): ensure Error Boundary catches render errors correctly by Parkreiner · Pull Request #15963 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix(site): ensure Error Boundary catches render errors correctly #15963

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

Merged
merged 11 commits into from
Jan 3, 2025
Prev Previous commit
Next Next commit
fix: format
  • Loading branch information
Parkreiner committed Dec 26, 2024
commit 4497e189996305b5bd5d97333f8d19b831ea644d
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta, StoryObj } from "@storybook/react";
import { GlobalErrorBoundaryInner } from "./GlobalErrorBoundary";
import { expect, userEvent } from "@storybook/test";
import { within } from "@testing-library/react";
import type { ErrorResponse } from "react-router-dom";
import { expect, userEvent } from "@storybook/test";
import { GlobalErrorBoundaryInner } from "./GlobalErrorBoundary";

/**
* React Router ErrorResponses have a "hidden" internal field that RR uses to
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/ErrorBoundary/GlobalErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import type { Interpolation } from "@emotion/react";
import Link from "@mui/material/Link";
import { Button } from "components/Button/Button";
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
import { useState, type FC } from "react";
import { type FC, useState } from "react";
import { Helmet } from "react-helmet-async";
import {
type ErrorResponse,
isRouteErrorResponse,
useLocation,
useRouteError,
type ErrorResponse,
} from "react-router-dom";

const errorPageTitle = "Something went wrong";
Expand Down
2 changes: 1 addition & 1 deletion site/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { GlobalErrorBoundary } from "components/ErrorBoundary/GlobalErrorBoundary";
import { TemplateRedirectController } from "pages/TemplatePage/TemplateRedirectController";
import { Suspense, lazy } from "react";
import {
Expand All @@ -22,7 +23,6 @@ import { UsersLayout } from "./pages/UsersPage/UsersLayout";
import UsersPage from "./pages/UsersPage/UsersPage";
import { WorkspaceSettingsLayout } from "./pages/WorkspaceSettingsPage/WorkspaceSettingsLayout";
import WorkspacesPage from "./pages/WorkspacesPage/WorkspacesPage";
import { GlobalErrorBoundary } from "components/ErrorBoundary/GlobalErrorBoundary";

// Lazy load pages
// - Pages that are secondary, not in the main navigation or not usually accessed
Expand Down
Loading
0