Skip to content

Commit

Permalink
Fix: Handle empty server response in API call
Browse files Browse the repository at this point in the history
  • Loading branch information
kidv committed Mar 23, 2024
1 parent ebbd870 commit 29e03b8
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 29e03b8

Please sign in to comment.