Skip to content

Commit 34caf3e

Browse files
committed
refactor: return not found in sandbox details layout on error
1 parent d6d5659 commit 34caf3e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/app/dashboard/[teamIdOrSlug]/sandboxes/[sandboxId]

src/app/dashboard/[teamIdOrSlug]/sandboxes/[sandboxId]/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import SandboxDetailsHeader from '@/features/dashboard/sandbox/header'
33
import SandboxDetailsTabs from '@/features/dashboard/sandbox/tabs'
44
import { resolveTeamIdInServerComponent } from '@/lib/utils/server'
55
import { getSandboxDetails } from '@/server/sandboxes/get-sandbox-details'
6+
import { notFound } from 'next/navigation'
67

78
export const fetchCache = 'default-cache'
89

@@ -21,7 +22,7 @@ export default async function SandboxLayout({
2122
const res = await getSandboxDetails({ teamId, sandboxId })
2223

2324
if (!res?.data || res?.serverError) {
24-
throw new Error(res?.serverError || 'Unable to get sandbox details')
25+
throw notFound()
2526
}
2627

2728
return (

0 commit comments

Comments
 (0)