chore: add id (#1234)

This commit is contained in:
josh 2025-09-21 19:06:54 +01:00 committed by GitHub
parent 947ed094a6
commit fffb0e8897
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -286,6 +286,8 @@ export async function POST(request: Request) {
return new Response(stream.pipeThrough(new JsonToSseTransformStream())); return new Response(stream.pipeThrough(new JsonToSseTransformStream()));
} catch (error) { } catch (error) {
const vercelId = request.headers.get('x-vercel-id');
if (error instanceof ChatSDKError) { if (error instanceof ChatSDKError) {
return error.toResponse(); return error.toResponse();
} }
@ -300,7 +302,7 @@ export async function POST(request: Request) {
return new ChatSDKError("bad_request:activate_gateway").toResponse(); return new ChatSDKError("bad_request:activate_gateway").toResponse();
} }
console.error("Unhandled error in chat API:", error); console.error("Unhandled error in chat API:", error, { vercelId });
return new ChatSDKError("offline:chat").toResponse(); return new ChatSDKError("offline:chat").toResponse();
} }
} }