# reportError ^6.8
上报bugly报告错误信息
# 请求参数
Prop | Type | Default | Comment |
---|---|---|---|
errorType | String | N/A | 错误类型,强烈建议,缺省 "weex error type" |
errorMsg | String | N/A | 错误信息,强烈建议,缺省 "weex error message" |
stack | Array | N/A | 错误堆栈,建议传错误的代码堆栈行 缺省“stack”, stack为堆栈list |
extraInfo | Object | N/A | 额外错误信息,{"key1":"value1","key2":"value2"}的jsonString格式 备注:错误上报会归类为“错误分析”选项中,“发生上报”到 "在bugluy可查询到错误信息"可能要一个小时的时间差 |
# 接口调用示例
const params = {
errorMsg: 'app selft test error message',
errorType: 'app selft test error',
stack: ['page1 line1', 'page2 line2', 'page3 line3', 'page4 line4'],
extraInfo: {
key1: 'value1',
key2: 'value2',
channel: 'weex'
}
}
this.$bridge
.reportError(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 返回参数
- 成功时返回
Prop | Type | Default | Description |
---|---|---|---|
errorCode | Number | N/A | 0 |
- 失败时返回
← pay trackEvent →