Better error logs for parseToolCall exceptions (#9857)

This commit is contained in:
Chris Estreich 2025-12-04 23:06:58 -08:00 committed by GitHub
parent 65c750d1be
commit 5c501600cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -756,8 +756,11 @@ export class NativeToolCallParser {
return result
} catch (error) {
console.error(`Failed to parse tool call arguments:`, error)
console.error(`Error details:`, error instanceof Error ? error.message : String(error))
console.error(
`Failed to parse tool call arguments: ${error instanceof Error ? error.message : String(error)}`,
)
console.error(`Tool call: ${JSON.stringify(toolCall, null, 2)}`)
return null
}
}