Skip to content

feat(UI-1434): implement Sentry error boundary #1103

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/organisms/code/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export const CodeTable = () => {
<Button
ariaLabel={t("buttons.createNewFile")}
className="group w-auto gap-1 p-0 font-semibold text-gray-500 hover:text-white"
onClick={() => openModal(ModalName.addCodeAssets)}
onClick={() => {
throw new Error("Test Error Boundary");
}}
>
<PlusCircle className="size-5 stroke-gray-500 duration-300 group-hover:stroke-white" />

Expand Down
15 changes: 9 additions & 6 deletions src/mainApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";

import "@utilities/getApiBaseUrl.utils";

import * as Sentry from "@sentry/react";
import { BrowserRouter } from "react-router-dom";

import { App } from "./app";
Expand All @@ -18,13 +19,15 @@ export const MainApp = () => {

return (
<BrowserRouter>
{descopeProjectId ? (
<DescopeWrapper>
<Sentry.ErrorBoundary fallback={<p>Error occurred</p>}>
{descopeProjectId ? (
<DescopeWrapper>
<App />
</DescopeWrapper>
) : (
<App />
</DescopeWrapper>
) : (
<App />
)}
)}
</Sentry.ErrorBoundary>
<Toast />
</BrowserRouter>
);
Expand Down
Loading