Skip to content

Commit 1aab97a

Browse files
committed
log open router error in web
1 parent f2a3d91 commit 1aab97a

File tree

1 file changed

+5
-1
lines changed
  • web/src/app/api/v1/chat/completions

1 file changed

+5
-1
lines changed

web/src/app/api/v1/chat/completions/_post.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,12 @@ export async function postChatCompletions(params: {
325325
return NextResponse.json(result)
326326
}
327327
} catch (error) {
328+
let openrouterError: OpenRouterError | undefined
329+
if (error instanceof OpenRouterError) {
330+
openrouterError = error
331+
}
328332
logger.error(
329-
{ error: getErrorObject(error), body },
333+
{ error: getErrorObject(error), body, openrouterError: openrouterError?.toJSON() },
330334
'Error with OpenRouter request',
331335
)
332336
trackEvent({

0 commit comments

Comments
 (0)