mirror of
https://github.com/WenPai-org/wpmind.git
synced 2025-08-03 02:48:41 +08:00
fixed displaying error message when request API failed
This commit is contained in:
parent
d3b0173dc9
commit
5193cb54b0
1 changed files with 4 additions and 1 deletions
|
@ -52,7 +52,10 @@ export default class BlocksStreamProcessor {
|
|||
const dataContent = line.slice(6);
|
||||
const data = JSON.parse(dataContent);
|
||||
|
||||
if (data.done === true) {
|
||||
if (data.error) {
|
||||
this.handleError(data);
|
||||
break;
|
||||
} else if (data.done === true) {
|
||||
if (this.jsonBuffer) {
|
||||
await this.parseAndDispatchBlocks(
|
||||
this.jsonBuffer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue