Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
替换Throw,不应把throw当成正常的流程控制
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekohy committed Nov 3, 2024
1 parent 9a2134d commit 622bc58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ async function ConvertOpenai(client, request, inputModel, OriginModel, stream) {
}
controller.enqueue(encoder.encode(`data: ${JSON.stringify(ChatCompletionStreamWithModel(response_message, OriginModel))}\n\n`));
} else {
throw new Error(`Invalid response code: ${response_code}`);
console.error(`Invalid response code: ${response_code}`);
controller.error(error);
}
} catch (error) {
console.error('Error processing stream data:', error);
Expand Down

0 comments on commit 622bc58

Please sign in to comment.