Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-Maria committed Feb 28, 2024
1 parent 2e61039 commit 31dd6d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,10 @@
source.addEventListener("error", (e) => {
if (done) return;
configuration = null;
let errorData;
let errorData: {};
try {
errorData = JSON.parse(e.data);
console.log(errorData);
} catch {
errorData = {
error: {
Expand All @@ -301,7 +302,7 @@
let errorMessage = errorData.error;
// Handle messages over the token limit
source.close();
/*source.close();
waitingForResponse = false;
if (errorMessage.includes("maximum context length")) {
if (originalMsg.length > 1) {
Expand All @@ -311,7 +312,7 @@
createStream(originalMsg, true);
return;
}
}
}*/
console.log("Stream closed on error");
console.error(e);
Expand Down

0 comments on commit 31dd6d4

Please sign in to comment.