fix: chat error message

This commit is contained in:
jialin
2024-09-27 19:19:56 +08:00
parent e48d21c8cb
commit 197488bff6
11 changed files with 68 additions and 30 deletions
+4 -2
View File
@@ -47,8 +47,10 @@ export const fetchChunkedData = async (params: {
}
});
if (!response.ok) {
throw new Error('Network response was not ok');
return null;
return {
error: true,
data: await response.json()
};
}
const reader = response?.body?.getReader();
const decoder = new TextDecoder('utf-8');