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); const message = extractMessage(resJson);
options.onFinish(message, res); options.onFinish(message, res);
} catch (e) { } catch (e) {
console.error("failed to chat", e); const error = e instanceof Error ? e : new Error('Unknown error occurred');
options.onError?.(e as Error); console.error("[Bedrock Client] Chat failed:", error.message);
options.onError?.(error);
} }
} }
} catch (e) { } catch (e) {