From f478c5e8264862992e213d27452728e42c65ce7a Mon Sep 17 00:00:00 2001 From: Arjun Attam Date: Tue, 30 Apr 2024 21:43:00 +0530 Subject: [PATCH] fix: fireworks errors are absorbed --- packages/ai/src/providers/fireworks/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/ai/src/providers/fireworks/index.ts b/packages/ai/src/providers/fireworks/index.ts index 02a97e4c..7b041d1d 100644 --- a/packages/ai/src/providers/fireworks/index.ts +++ b/packages/ai/src/providers/fireworks/index.ts @@ -77,7 +77,11 @@ const createChatCompletion: ICreateChatCompletion = async (body) => { executionDone(); return { ...completion, latency }; } catch (err) { - throw new AIError(AIErrorEnum.FAILED_CHAT_COMPLETION, "Unknown error"); + if (err instanceof AIError) { + throw err; + } else { + throw new AIError(AIErrorEnum.FAILED_CHAT_COMPLETION, "Unknown error"); + } } };