Skip to content

Commit

Permalink
Port skripnik@a3c4f15 from major
Browse files Browse the repository at this point in the history
  • Loading branch information
tonythomas01 committed May 25, 2023
1 parent 44d2445 commit a8935cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ async function fetchSummaryUsingOpenAi(fixedPromptForChatGPT, openAiKey, section
temperature: 0
}),
});
if (response.status !== 200) {
const errorText = await response.text();
console.error("Error:", errorText);
callback(new Error(`API responded with status ${response.status}: ${errorText}`));
return;
}


const reader = response.body.getReader();
const decoder = new TextDecoder("utf-8");
Expand Down

0 comments on commit a8935cd

Please sign in to comment.