Skip to content

Commit 877267f

Browse files
committed
add more logging to 500 errors
1 parent f6b7413 commit 877267f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,16 @@ export async function chatCompletionsPost(params: {
249249
return NextResponse.json(result)
250250
}
251251
} catch (error) {
252-
logger.error(getErrorObject(error), 'Error with OpenRouter request')
252+
logger.error(
253+
{ error: getErrorObject(error), body },
254+
'Error with OpenRouter request',
255+
)
253256
trackEvent({
254257
event: AnalyticsEvent.CHAT_COMPLETIONS_ERROR,
255258
userId,
256259
properties: {
257260
error: error instanceof Error ? error.message : 'Unknown error',
261+
body,
258262
agentId,
259263
streaming: bodyStream,
260264
},

0 commit comments

Comments
 (0)