fix: should not swallow copilot errors (#6609)

This commit is contained in:
pengx17
2024-04-18 09:59:31 +00:00
parent 19f8407d7f
commit e232b0b285
@@ -84,7 +84,7 @@ export class CopilotClient {
return res.currentUser?.copilot?.histories; return res.currentUser?.copilot?.histories;
} }
chatText({ async chatText({
sessionId, sessionId,
messageId, messageId,
message, message,
@@ -113,13 +113,8 @@ export class CopilotClient {
}); });
} }
return new Promise(resolve => { const response = await fetch(url.toString());
fetch(url.toString()) return response.text();
.then(res => {
resolve(res.text());
})
.catch(console.error);
});
} }
// Text or image to text // Text or image to text