- 它是一个数组,数组中的元素为过滤规则,当错误符合数组中任意一条过滤规则时,则会被过滤
- 过滤规则是JavaScript对象,该对象的Key为错误的属性名,Value为正则表达式(唯一的特例是”inexistence”);
- 当错误的属性匹配对应正则表达式时,则会被过滤;
- 当过滤规则的属性值为”inexistence”时,则会过滤某个属性不存在的错误;
"name": "ReferenceError",
"message": "b is not defined",
"stack": "ReferenceError: b is not defined\n at http://127.0.0.1:14988/game/game.js:80:5\n at require (http://127.0.0.1:14988/game/__dev__/WAGame.js:3:13718)\n at http://127.0.0.1:14988/game/gamePage.html:149:5",
"type": "caught",
"metaData":
{
"name": "Fundebug",
"nation": "China"
},
"notifierVersion": "0.2.0",
"releaseStage": "development",
"appVersion": "3.2.5",
"systemInfo":
{
"errMsg": "getSystemInfo:ok",
"model": "iPhone 5",
"pixelRatio": 2,
"windowWidth": 320,
"system": "iOS 10.0.1",
"language": "zh_CN",
"version": "6.6.3",
"screenWidth": 320,
"screenHeight": 568,
"SDKVersion": "2.0.9",
"brand": "devtools",
"fontSizeSetting": 16,
"benchmarkLevel": 1,
"batteryLevel": 100,
"statusBarHeight": 20,
"platform": "devtools"
},
"time": 1528937703693
示例1:过滤ReferenceError的错误
fundebug.init(
{
apikey: "API-KEY",
filters: [
req:
{
url: /example\.com/,
method: /^GET$/
}
}]
});
示例3:过滤statusCode为401的HTTP请求错误
fundebug.init(
{
apikey: "API-KEY",
filters: [
{
name: /^ReferenceError$/,
systemInfo:
{
"model": /^iPhone 5$/,
}
}]
示例5:配置多条过滤规则