Skip to content

Commit 59622b7

Browse files
authored
Merge pull request #1409 from b4s36t4/fix/bedrock-types
fix: return Response instead of object, typescript
2 parents b5a7825 + fb287d9 commit 59622b7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/providers/bedrock/getBatchOutput.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const BedrockGetBatchOutputRequestHandler = async ({
5151
c: Context;
5252
providerOptions: Options;
5353
requestURL: string;
54-
}) => {
54+
}): Promise<Response> => {
5555
try {
5656
// get s3 file id from batch details
5757
// get file from s3
@@ -79,7 +79,7 @@ export const BedrockGetBatchOutputRequestHandler = async ({
7979

8080
if (!retrieveBatchesResponse.ok) {
8181
const error = await retrieveBatchesResponse.text();
82-
return generateErrorResponse(
82+
const _response = generateErrorResponse(
8383
{
8484
message: error,
8585
type: null,
@@ -88,6 +88,13 @@ export const BedrockGetBatchOutputRequestHandler = async ({
8888
},
8989
BEDROCK
9090
);
91+
92+
return new Response(JSON.stringify(_response), {
93+
status: 500,
94+
headers: {
95+
'Content-Type': 'application/json',
96+
},
97+
});
9198
}
9299

93100
const batchDetails: BedrockGetBatchResponse =

0 commit comments

Comments
 (0)