sobey-monitor-sdk 1.1.18 → 1.1.19

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.
@@ -110,6 +110,21 @@ export interface ErrorMonitorConfig {
110
110
  * 例如: [404, 500, 502, 503, 504]
111
111
  */
112
112
  httpErrorStatusCodes?: number[];
113
+ /**
114
+ * 是否上报网络错误(请求失败,无法连接到服务器)
115
+ * 默认值: false
116
+ */
117
+ reportNetworkError?: boolean;
118
+ /**
119
+ * 是否上报请求超时错误
120
+ * 默认值: false
121
+ */
122
+ reportTimeoutError?: boolean;
123
+ /**
124
+ * 是否上报请求取消错误(用户主动取消或页面切换导致的取消)
125
+ * 默认值: false
126
+ */
127
+ reportAbortError?: boolean;
113
128
  }
114
129
  /**
115
130
  * 性能监控配置
@@ -217,6 +232,13 @@ export interface HttpInfo {
217
232
  requestBody?: string;
218
233
  /** 响应体 */
219
234
  responseBody?: string;
235
+ /**
236
+ * 错误类型(当 status 为 0 时)
237
+ * - 'timeout': 请求超时
238
+ * - 'abort': 请求被取消
239
+ * - 'network': 网络错误
240
+ */
241
+ errorType?: 'timeout' | 'abort' | 'network';
220
242
  }
221
243
  /**
222
244
  * 性能数据
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sobey-monitor-sdk",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "前端全方位监控 SDK,支持错误监控、性能监控、用户行为回溯。适合单页面应用及多端环境。",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",