Try to make OpenAI errors more useful (#9639)

This commit is contained in:
Matt Rubens 2025-12-08 17:21:29 -08:00 • committed by GitHub
parent 375c103bd3
commit 93a43e427e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,7 +13,7 @@ import i18n from "../../../i18n/setup"
*/
export function handleOpenAIError(error: unknown, providerName: string): Error {
if (error instanceof Error) {
const msg = error.message || ""
const msg = (error as any)?.error?.metadata?.raw || error.message || ""
// Log the original error details for debugging
console.error(`[${providerName}] API error:`, {