@howone/sdk 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3421,12 +3421,22 @@ var ErrorTracking = class {
|
|
|
3421
3421
|
}, 5e3);
|
|
3422
3422
|
return false;
|
|
3423
3423
|
}
|
|
3424
|
+
/**
|
|
3425
|
+
* 判断是否是 504 错误,需要立即发送
|
|
3426
|
+
*/
|
|
3427
|
+
isCriticalNetworkError(error, details) {
|
|
3428
|
+
const message = error.message?.toLowerCase() || "";
|
|
3429
|
+
return message.includes("504") || message.includes("gateway timeout");
|
|
3430
|
+
}
|
|
3424
3431
|
/**
|
|
3425
3432
|
* 发送统一格式的错误
|
|
3426
3433
|
*/
|
|
3427
3434
|
sendUnifiedError(error, details = {}) {
|
|
3428
3435
|
if (window.parent === window) return;
|
|
3429
|
-
|
|
3436
|
+
const isCriticalError = this.isCriticalNetworkError(error, details);
|
|
3437
|
+
if (!isCriticalError && !this.fullyInitialized) {
|
|
3438
|
+
return;
|
|
3439
|
+
}
|
|
3430
3440
|
try {
|
|
3431
3441
|
const currentViewInfo = this.viewDetector?.getCurrentViewInfo();
|
|
3432
3442
|
const payload = {
|