Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error boundary
Browse files Browse the repository at this point in the history
lkostrowski committed Jun 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b202b9f commit 59f1cc7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/apps/components/AppDetailsPage/AppDetailsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { AppQuery } from "@dashboard/graphql";
import errorTracker from "@dashboard/services/errorTracking";
import { Box, Text } from "@saleor/macaw-ui/next";
import React from "react";
import { ErrorBoundary } from "react-error-boundary";

import { AboutCard } from "./AboutCard";
import { DataPrivacyCard } from "./DataPrivacyCard";
@@ -26,7 +29,14 @@ export const AppDetailsPage: React.FC<AppDetailsPageProps> = ({
}

return (
<>
<ErrorBoundary
onError={errorTracker.captureException}
fallbackRender={() => (
<Box padding={4}>
<Text>Error, please refresh the page</Text>
</Box>
)}
>
<Header
data={data}
onAppActivateOpen={onAppActivateOpen}
@@ -44,7 +54,7 @@ export const AppDetailsPage: React.FC<AppDetailsPageProps> = ({
dataPrivacyUrl={data?.dataPrivacyUrl}
loading={loading}
/>
</>
</ErrorBoundary>
);
};

0 comments on commit 59f1cc7

Please sign in to comment.