feat: modify the output method of rendering module parsing errors

This commit is contained in:
liujuping 2022-05-19 11:47:14 +08:00 committed by LeoYuan 袁力皓
parent aa6b9c8f7a
commit 8255b79458

View File

@ -1,6 +1,6 @@
/* eslint-disable no-console */
/* eslint-disable no-new-func */
import Debug from 'debug';
import logger from './logger';
import { isI18nData, RootSchema, NodeSchema, isJSExpression, JSSlot } from '@alilc/lowcode-types';
// moment对象配置
import _moment from 'moment';
@ -36,8 +36,6 @@ const EXPRESSION_TYPE = {
I18N: 'i18n',
};
const debug = Debug('utils:index');
/**
* check if schema passed in is a valid schema
* @name isSchema
@ -264,7 +262,7 @@ export function parseExpression(str: any, self: any) {
const code = `with($scope || {}) { ${tarStr} }`;
return new Function('$scope', code)(self);
} catch (err) {
debug('parseExpression.error', err, str, self);
logger.error('parseExpression.error', err, str, self);
return undefined;
}
}