|
@@ -43,6 +43,16 @@ window.addEventListener("error", function (event) {
|
|
window.addEventListener("unhandledrejection", function (event) {
|
|
window.addEventListener("unhandledrejection", function (event) {
|
|
// 此错误由上传阿里云日志触发,会被重复好几次
|
|
// 此错误由上传阿里云日志触发,会被重复好几次
|
|
// 改为fetch,阿里云日志的错误不应该触发到这里
|
|
// 改为fetch,阿里云日志的错误不应该触发到这里
|
|
|
|
+
|
|
|
|
+ // 这会触发Circular JSON error
|
|
|
|
+ if (event.reason.name === "NavigationDuplicated") {
|
|
|
|
+ createLog({
|
|
|
|
+ action: "unhandledrejection错误",
|
|
|
|
+ page: window.location.pathname,
|
|
|
|
+ reason: "NavigationDuplicated",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
console.log(
|
|
console.log(
|
|
"unhandledrejection event",
|
|
"unhandledrejection event",
|
|
event,
|
|
event,
|