Roo-Code/src/api/providers/utils/openai-error-handler.ts
Bruno Bergher 6e2b85214e
ux: improve API error handling and visibility (#10204)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-12-19 11:38:56 -08:00

19 lines
733 B
TypeScript

/**
* General error handler for OpenAI client errors
* Transforms technical errors into user-friendly messages
*
* @deprecated Use handleProviderError from './error-handler' instead
* This file is kept for backward compatibility
*/
import { handleProviderError } from "./error-handler"
/**
* Handles OpenAI client errors and transforms them into user-friendly messages
* @param error - The error to handle
* @param providerName - The name of the provider for context in error messages
* @returns The original error or a transformed user-friendly error
*/
export function handleOpenAIError(error: unknown, providerName: string): Error {
return handleProviderError(error, providerName, { messagePrefix: "completion" })
}