Skip to content

Commit

Permalink
add fallback for unexpected error
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Mar 28, 2024
1 parent ac5a558 commit 001f4b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ErrorComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ export default function ErrorComponent({
return (
<Stack p="md">
<Title>An error ocurred</Title>
{error instanceof Error && (
{error instanceof Error ? (
<>
<Text>
<b>{error.name}:</b> {error.message}
</Text>
<Code>{error.stack}</Code>
{error.cause}
</>
) : (
<Text>
<b>Unexpected Error:</b> {JSON.stringify(error)}
</Text>
)}
<Group>
{error instanceof Error && (
Expand Down

0 comments on commit 001f4b5

Please sign in to comment.