From 5193cb54b0fdcba26fea99aaa9de61d2847c8aa3 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 25 Dec 2024 11:43:43 +0300 Subject: [PATCH] fixed displaying error message when request API failed --- src/editor/processors/blocks-stream-processor/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/processors/blocks-stream-processor/index.js b/src/editor/processors/blocks-stream-processor/index.js index 24629f9..e1915d0 100644 --- a/src/editor/processors/blocks-stream-processor/index.js +++ b/src/editor/processors/blocks-stream-processor/index.js @@ -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,