@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
16 lines (12 loc) • 352 B
text/typescript
export const handleAnthropicError = (error: any) => {
let errorResult: any = error;
if (error.error) {
errorResult = error.error;
if ('error' in errorResult) {
errorResult = errorResult.error;
}
} else {
errorResult = { headers: error.headers, stack: error.stack, status: error.status };
}
return { errorResult };
};