优化写法2

This commit is contained in:
shijian 2024-01-11 00:35:46 +08:00
parent c576ced96c
commit 57d08d0982
1 changed files with 2 additions and 2 deletions

View File

@ -762,8 +762,8 @@ function setWindowListener() {
errorList.push([e, stackTraces]);
};
// 已经有用了
window.addEventListener("unhandledrejection", PromiseRejectionEvent => {
PromiseRejectionEvent.promise.catch(e => {
window.addEventListener("unhandledrejection", promiseRejectionEvent => {
promiseRejectionEvent.promise.catch(e => {
const result = errorList.find(v => v[0] === e);
if (result) {
// @ts-ignore