Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#4379 from EasonQwQ/main
Browse files Browse the repository at this point in the history
Fix: Handle empty server response in API call
  • Loading branch information
fred-bf authored Mar 24, 2024
2 parents 90af4e3 + 29e03b8 commit f1b4c08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/client/platforms/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ export class ChatGPTApi implements LLMApi {
if (finished || controller.signal.aborted) {
responseText += remainText;
console.log("[Response Animation] finished");
if (responseText?.length === 0) {
options.onError?.(new Error("empty response from server"));
}
return;
}

Expand Down

0 comments on commit f1b4c08

Please sign in to comment.