Skip to content

Commit 74a49c7

Browse files
fix: handle all possible tagged errors in the layout (#319)
1 parent 4f154f6 commit 74a49c7

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

apps/web/src/routes/_app/layout.tsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,23 @@ function AppShell() {
7777

7878
if (!user && Option.isSome(error)) {
7979
const errorValue = error.value
80-
if (errorValue._tag === "SessionLoadError") {
81-
return (
82-
<div className="flex h-screen flex-col items-center justify-center gap-6">
83-
<div className="flex w-full max-w-md flex-col items-center gap-4 text-center">
84-
<h1 className="font-bold font-mono text-2xl text-danger">
85-
Service Temporarily Unavailable
86-
</h1>
87-
<Text>
88-
We're having trouble connecting to the authentication service. This is usually
89-
temporary.
90-
</Text>
91-
<Text className="text-muted-fg text-xs">{errorValue.message}</Text>
92-
<Button intent="primary" onPress={() => window.location.reload()}>
93-
Retry
94-
</Button>
95-
</div>
80+
return (
81+
<div className="flex h-screen flex-col items-center justify-center gap-6">
82+
<div className="flex w-full max-w-md flex-col items-center gap-4 text-center">
83+
<h1 className="font-bold font-mono text-2xl text-danger">
84+
Service Temporarily Unavailable
85+
</h1>
86+
<Text>
87+
We're having trouble connecting to the authentication service. This is usually
88+
temporary.
89+
</Text>
90+
<Text className="text-muted-fg text-xs">{errorValue.message}</Text>
91+
<Button intent="primary" onPress={() => window.location.reload()}>
92+
Retry
93+
</Button>
9694
</div>
97-
)
98-
}
99-
return <Loader />
95+
</div>
96+
)
10097
}
10198

10299
if (!user) return <Loader />

0 commit comments

Comments
 (0)