From 417426d5dd349705aa3ee0b5b19d9c5ba4bd2622 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 5 Sep 2024 14:27:54 -0500 Subject: [PATCH] vision bois --- app/api/image/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/image/route.ts b/app/api/image/route.ts index f25ea1b..0b74f8f 100644 --- a/app/api/image/route.ts +++ b/app/api/image/route.ts @@ -50,6 +50,10 @@ export async function POST(req: Request) { return NextResponse.json(data); } catch (error) { console.error('Error processing image:', error); - return NextResponse.json({ error: 'Error processing image', details: error.message }, { status: 500 }); + if (error instanceof Error) { + return NextResponse.json({ error: 'Error processing image', details: error.message }, { status: 500 }); + } else { + return NextResponse.json({ error: 'Error processing image', details: 'An unknown error occurred' }, { status: 500 }); + } } }