Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 2fb7364

Browse files
committed
refactor: disconnected certain errors from tack.js, changed copy text
1 parent 9fd07c2 commit 2fb7364

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/botPage/view/blockly/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ export const load = (blockStr, dropEvent = {}) => {
200200
const blocklyXml = xml.querySelectorAll('block');
201201

202202
if (!blocklyXml.length) {
203-
const error = new TrackJSError(
204-
'FileLoad',
205-
translate('XML file contains unsupported elements. Please check or modify file.')
206-
);
203+
const error = new Error(translate('XML file is empty. Please check or modify file.'));
207204
globalObserver.emit('Error', error);
208205
return;
209206
}
@@ -239,9 +236,11 @@ export const load = (blockStr, dropEvent = {}) => {
239236
const blockType = block.getAttribute('type');
240237

241238
if (!Object.keys(Blockly.Blocks).includes(blockType)) {
242-
const error = new TrackJSError(
243-
'FileLoad',
244-
translate('XML file contains unsupported elements. Please check or modify file.')
239+
const blockId = block.getAttribute('id');
240+
const error = new Error(
241+
translate(
242+
`The block ${blockId} in the XML file contains unsupported elements.\nTo fix that open XML file in the text editor, search for block id ${blockId}, and check it's attributes for errors.`
243+
)
245244
);
246245
globalObserver.emit('Error', error);
247246
throw error;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy