@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.mjs
CHANGED
|
@@ -3350,12 +3350,22 @@ var ErrorTracking = class {
|
|
|
3350
3350
|
}, 5e3);
|
|
3351
3351
|
return false;
|
|
3352
3352
|
}
|
|
3353
|
+
/**
|
|
3354
|
+
* 判断是否是 504 错误,需要立即发送
|
|
3355
|
+
*/
|
|
3356
|
+
isCriticalNetworkError(error, details) {
|
|
3357
|
+
const message = error.message?.toLowerCase() || "";
|
|
3358
|
+
return message.includes("504") || message.includes("gateway timeout");
|
|
3359
|
+
}
|
|
3353
3360
|
/**
|
|
3354
3361
|
* 发送统一格式的错误
|
|
3355
3362
|
*/
|
|
3356
3363
|
sendUnifiedError(error, details = {}) {
|
|
3357
3364
|
if (window.parent === window) return;
|
|
3358
|
-
|
|
3365
|
+
const isCriticalError = this.isCriticalNetworkError(error, details);
|
|
3366
|
+
if (!isCriticalError && !this.fullyInitialized) {
|
|
3367
|
+
return;
|
|
3368
|
+
}
|
|
3359
3369
|
try {
|
|
3360
3370
|
const currentViewInfo = this.viewDetector?.getCurrentViewInfo();
|
|
3361
3371
|
const payload = {
|