-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle global errors + fix fetch sequence number crash (#1135)
- Loading branch information
Showing
2 changed files
with
79 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
"use client"; | ||
|
||
import { Button, Card, Heading, Icon, Text } from "@stellar/design-system"; | ||
import { Box } from "@/components/layout/Box"; | ||
import { LayoutContentContainer } from "@/components/layout/LayoutContentContainer"; | ||
import { openUrl } from "@/helpers/openUrl"; | ||
|
||
export default function Error({ | ||
error, | ||
}: { | ||
error: Error & { digest?: string }; | ||
}) { | ||
// TODO: track this in Sentry once set up | ||
console.log("Unhandled error: ", error); | ||
|
||
return ( | ||
<LayoutContentContainer> | ||
<Card> | ||
<Box gap="xl" align="start"> | ||
<Box gap="md"> | ||
<Heading as="h2" size="xs" weight="medium"> | ||
Unhandled Error | ||
</Heading> | ||
|
||
<Text size="sm" as="p"> | ||
Uh-oh, we didn’t handle this error. We would appreciate it if you | ||
opened an issue on GitHub, providing as many details as possible | ||
to help us fix this bug. | ||
</Text> | ||
</Box> | ||
|
||
<Box gap="md" direction="row"> | ||
<Button | ||
size="sm" | ||
variant="secondary" | ||
icon={<Icon.ArrowLeft />} | ||
iconPosition="left" | ||
onClick={() => { | ||
location.reload(); | ||
}} | ||
> | ||
Return | ||
</Button> | ||
|
||
<Button | ||
size="sm" | ||
variant="primary" | ||
iconPosition="left" | ||
onClick={() => | ||
openUrl("https://github.com/stellar/laboratory/issues") | ||
} | ||
> | ||
Open Issue | ||
</Button> | ||
</Box> | ||
</Box> | ||
</Card> | ||
</LayoutContentContainer> | ||
); | ||
} |
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