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

Commit 2d608ee

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

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/botPage/view/blockly/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import GTM from '../../../common/gtm';
2929
import { parseQueryString, isProduction } from '../../../common/utils/tools';
3030
import { TrackJSError } from '../logger';
3131
import { createDataStore } from '../../bot/data-collection';
32+
import { createError } from '../../common/error';
3233
import config from '../../common/const';
3334

3435
const disableStrayBlocks = () => {
@@ -200,10 +201,7 @@ export const load = (blockStr, dropEvent = {}) => {
200201
const blocklyXml = xml.querySelectorAll('block');
201202

202203
if (!blocklyXml.length) {
203-
const error = new TrackJSError(
204-
'FileLoad',
205-
translate('XML file contains unsupported elements. Please check or modify file.')
206-
);
204+
const error = createError('EmptyXML', translate('XML file is empty. Please check or modify file.'));
207205
globalObserver.emit('Error', error);
208206
return;
209207
}
@@ -239,9 +237,12 @@ export const load = (blockStr, dropEvent = {}) => {
239237
const blockType = block.getAttribute('type');
240238

241239
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.')
240+
const blockId = block.getAttribute('id');
241+
const error = createError(
242+
'InvalidBlockInXML',
243+
translate(
244+
`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.`
245+
)
245246
);
246247
globalObserver.emit('Error', error);
247248
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