mirror of
https://github.com/WenPai-org/wpmind.git
synced 2025-08-03 19:19:46 +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 dataContent = line.slice(6);
|
||||||
const data = JSON.parse(dataContent);
|
const data = JSON.parse(dataContent);
|
||||||
|
|
||||||
if (data.done === true) {
|
if (data.error) {
|
||||||
|
this.handleError(data);
|
||||||
|
break;
|
||||||
|
} else if (data.done === true) {
|
||||||
if (this.jsonBuffer) {
|
if (this.jsonBuffer) {
|
||||||
await this.parseAndDispatchBlocks(
|
await this.parseAndDispatchBlocks(
|
||||||
this.jsonBuffer,
|
this.jsonBuffer,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue