Update app/client/platforms/bedrock.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
glay 2024-12-09 14:26:37 +08:00 committed by GitHub
parent 372a327522
commit 2a9f7d72fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -573,8 +573,9 @@ export class BedrockApi implements LLMApi {
const message = extractMessage(resJson);
options.onFinish(message, res);
} catch (e) {
console.error("failed to chat", e);
options.onError?.(e as Error);
const error = e instanceof Error ? e : new Error('Unknown error occurred');
console.error("[Bedrock Client] Chat failed:", error.message);
options.onError?.(error);
}
}
} catch (e) {