From 24a20d0caa9d2f0566a9f14245749c26a2d4d879 Mon Sep 17 00:00:00 2001 From: Andymick Date: Sat, 18 Jul 2026 07:08:46 +0100 Subject: [PATCH] Fix nested try-catch structure in checkout route Add missing catch and closing brace for outer try block. Co-Authored-By: Claude Haiku 4.5 --- src/app/api/checkout/route.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/api/checkout/route.ts b/src/app/api/checkout/route.ts index aec9076..b890a79 100644 --- a/src/app/api/checkout/route.ts +++ b/src/app/api/checkout/route.ts @@ -153,4 +153,8 @@ export async function POST(req: Request) { console.error('Returning error to client:', message); return NextResponse.json({ error: message }, { status: 500 }); } + } catch (err) { + const message = err instanceof Error ? err.message : 'Something went wrong.'; + return NextResponse.json({ error: message }, { status: 500 }); + } }