Skip to content

Commit

Permalink
Update app/client/platforms/bedrock.ts
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
glayyiyi and coderabbitai[bot] authored Dec 9, 2024
1 parent a088687 commit 44a1cf6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/client/platforms/bedrock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,21 +826,26 @@ function bedrockStream(
index = result.index;
}
} catch (err) {
console.error("[Bedrock Stream Error]:", err);
throw err;
console.error(
"[Bedrock Stream]:",
err instanceof Error ? err.message : "Stream processing failed"
);
throw new Error("Failed to process stream response");
} finally {
reader.releaseLock();
finish();
}
} catch (e) {
// @ts-ignore
if (e.name === "AbortError") {
if (e instanceof Error && e.name === "AbortError") {
console.log("[Bedrock Client] Aborted by user");
return;
}
console.error("[Bedrock Request] error", e);
console.error(
"[Bedrock Request] Failed:",
e instanceof Error ? e.message : "Request failed"
);
options.onError?.(e);
throw e;
throw new Error("Request processing failed");
}
}

Expand Down

0 comments on commit 44a1cf6

Please sign in to comment.