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
No known key found for this signature in database
GPG Key ID: 23F23D9E8B3971ED

View File

@ -84,7 +84,7 @@ export class CopilotClient {
return res.currentUser?.copilot?.histories;
}
chatText({
async chatText({
sessionId,
messageId,
message,
@ -113,13 +113,8 @@ export class CopilotClient {
});
}
return new Promise(resolve => {
fetch(url.toString())
.then(res => {
resolve(res.text());
})
.catch(console.error);
});
const response = await fetch(url.toString());
return response.text();
}
// Text or image to text