Skip to content

Commit 9bd8f14

Browse files
authored
fix(workspace): add granular error boundaries to 7 more workspace segments (#5207)
Adds error.tsx (reusing the shared ErrorState) to home, integrations, knowledge/[id], skills, settings, scheduled-tasks, and chat/[chatId] so a crash in any of these panels stays scoped to the panel and offers a retry, instead of bubbling to the generic workspace-level boundary.
1 parent 6260eda commit 9bd8f14

7 files changed

Lines changed: 105 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function ChatError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load chat'
11+
description='Something went wrong while loading this chat. Please try again.'
12+
loggerName='ChatError'
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function HomeError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load home'
11+
description='Something went wrong while loading your workspace home. Please try again.'
12+
loggerName='HomeError'
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function IntegrationsError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load integrations'
11+
description='Something went wrong while loading your integrations. Please try again.'
12+
loggerName='IntegrationsError'
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function KnowledgeBaseError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load knowledge base'
11+
description='Something went wrong while loading this knowledge base. Please try again.'
12+
loggerName='KnowledgeBaseError'
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function ScheduledTasksError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load scheduled tasks'
11+
description='Something went wrong while loading your scheduled tasks. Please try again.'
12+
loggerName='ScheduledTasksError'
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function SettingsError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load settings'
11+
description='Something went wrong while loading your settings. Please try again.'
12+
loggerName='SettingsError'
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client'
2+
3+
import { type ErrorBoundaryProps, ErrorState } from '@/app/workspace/[workspaceId]/components'
4+
5+
export default function SkillsError({ error, reset }: ErrorBoundaryProps) {
6+
return (
7+
<ErrorState
8+
error={error}
9+
reset={reset}
10+
title='Failed to load skills'
11+
description='Something went wrong while loading your skills. Please try again.'
12+
loggerName='SkillsError'
13+
/>
14+
)
15+
}

0 commit comments

Comments
 (0)