rs-reverse/utils/error.js

15 lines
451 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const gv = require('@src/handler/globalVarible');
const logger = require('./logger');
const errorMap = {
9999: '未知报错!',
1000: '解码cd值发现未定义任务方法',
}
module.exports = function(type, data = {}) {
Object.assign(data, gv._getAttr('_ts'));
data.errType = type;
logger.fatal(`(${type})程序出错啦请将该段报错文本贴到issue中${JSON.stringify(data)}`);
throw new Error(errorMap[type] || type);
}