fastchar-appjs
Version:
快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html,不使用vue单页面功能。
39 lines (38 loc) • 1.4 kB
JavaScript
define(["require", "exports", "./FastNative", "./FastHelper"], function (require, exports, FastNative_1, FastHelper_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FastErrorHandler = void 0;
/**
* 全局异常信息拦截
*/
var FastErrorHandler = /** @class */ (function () {
function FastErrorHandler() {
}
/**
* 初始化异常信息的拦截
*/
FastErrorHandler.initErrorHandler = function () {
window.addEventListener("error", function (event) {
try {
console.error(event);
FastNative_1.FastNative.BaseApp.reportBug(FastHelper_1.FastHelper.Events.geErrorInfo(event));
}
catch (e) {
console.error(e);
}
});
window.addEventListener("unhandledrejection", function (event) {
try {
console.error(event);
FastNative_1.FastNative.BaseApp.reportBug(FastHelper_1.FastHelper.Events.geErrorInfo(event));
}
catch (e) {
console.error(e);
}
});
};
return FastErrorHandler;
}());
exports.FastErrorHandler = FastErrorHandler;
FastErrorHandler.initErrorHandler();
});