跳到主要内容

JS错误

概览

错误类型趋势

POST /jserror/jserror-trend

请求参数类型必选参数说明
mpIdNumber小程序ID
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果: (Highcharts图通用返回结果)

JS错误类型列表

POST /jserror/type-list

请求参数类型必选参数说明
mpIdNumber小程序ID
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果:


[{
"errorMessage": "ReferenceError: i is not defined", // 错误类型
"errorPv": 4,
"minTime": 1545120000000, // 最早错误发生时间
"maxTime": 1545123540000, // 最晚错误发生时间
"errorRatio": 6.67,
"wechatVersion": "6.6.3" //微信版本
},
...]

详情

错误数量趋势

POST /jserror/jserror-type-count

请求参数类型必选参数说明
mpIdNumber小程序ID
jsErrorStringJS类型
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果: (Highcharts图通用返回结果)

JS错误追踪

TOP5维度指标饼图

POST /jserror/pie

dimension选项列表:

名称dimension
网络类型networkType
微信版本wechatVersion
地域和运营商regionId,carrierId
系统版本system
设备deviceType
页面path

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序ID
dimensionTypeString维度key, 区分饼图类型, 参考dimension选项列表
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
jsErrorStringjs类型

返回结果:

[
{
"name": "2G",
"value": 1,
"dimension": {
"networkType": "2G"
}
},
...
{
"name": "Other", // top5之外数据记录, 没有dimension项
"value": 10
}
]

JS错误列表

POST /abnormal/jserror/list

Content-Type: application/json

请求示例:

{
"timePeriod": 30,
"endTime": "",
"mpId": 111,
"jsError": "xxx",
"filter": [
{
"dimension": "ip",
"values": ["192.168.1.100", "192.168.1.111"],
"searchValue": "192.168.1"
},
{
"dimension": "regionId,carrierId",
"values": ["4811,12000", "4811,12000"]
}
...
]
}

返回数据:

[
{
"timestamp": "2019-11-27 15:16",
"id": "Y5G4q24Bw-wCxOz_N0tj",
"agentVersion": "1.3.6",
"applicationId": 0,
"carrierId": 0,
"cityId": 0,
"countryId": 0,
"instanceId": 0,
"mpId": 2065,
"errorMessage": "Random js error",
"ip": "192.168.5.149",
"deviceType": "Nexus 5",
"messageType": "JSERROR",
"networkType": "wifi",
"msgErrorPv": 1,
"occurTime": 1574839003087,
"openPath": "pages/index/index",
"path": "pages/index/index",
"pageTraceId": "f613a6ea8fd64ce1bee96d6f2b4d59e1",
"regionId": 0,
"sid": "48cac7ec-7a22-48b0-bc5f-93c3e957abef",
"uid": "5847de28-2b35-4d6e-b977-ff54a685c7d4",
"scene": "1001",
"system": "Android 5.0",
"wechatVersion": "7.0.4",
"trace": false
},
...

]

JS错误trace详情

JS错误trace详情

POST /abnormal/jserror/detail

请求参数类型必选参数说明
mpIdNumber小程序ID
traceIdString当指定traceId 时, 只查询这条trace
pageNoNumber分页页号, 从1开始
pageSizeNumber每次查一条
minTimeNumber开始时间
maxTimeNumber结束时间
pathStringpath
wechatVersionStringwechatVersion
jsErrorTypeStringjsErrorType
networkTypeString网络请求
countryIdNumber
regionIdNumber
cityIdNumber
carrierIdNumber

返回结果:

[
{
"traceId": "xxxxx",
"timestamp": "2019-11-27 15:16",
"path": "pages/index/index",
"wechatVersion": "7.0.4",
"sdkVersion": "2.9.3",
"system": "Android 5.0",
"deviceType": "Nexus 5",
"networkType": "wifi",
"width": "360",
"height": "518",
"region": "未知",
"city": "未知",
"carrier": "未知",
"ip": "192.168.5.149",
"ua": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Mobile Safari/537.36 wechatdevtools/1.02.1910120 MicroMessenger/7.0.4 webview/",
"time": "2019-11-27 15:16",
"msg": "xxxx",
"lineno": 0,
"colno": 0,
"stack": "thirdScriptError\nRandom js error;at \"pages/index/index\" page lifeCycleMethod onShow function\nError: Random js error\n at _e.onShow (http://127.0.0.1:13201/appservice/pages/index/index.js:99:13)\n at _e.onShow (http://127.0.0.1:13201/appservice/agent/bundle.js:75:25)\n at _e.<anonymous> (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1531191)\n at _e.p.__callPageLifeTime__ (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1530936)\n at http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1549262\n at xt (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1549407)\n at Function.<anonymous> (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1553690)\n at i.<anonymous> (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1522455)\n at i.emit (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:551893)\n at Object.emit (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:539354)",
"uid": "5847de28-2b35-4d6e-b977-ff54a685c7d4"
}
]