unhandledrejection

2019-02-20 15:38 更新

unhandledrejection,即未使用catch處理的Promise錯誤:

Promise.reject("hello");

Fundebug插件捕獲的這個錯誤之后,開發(fā)者將受到報警,然后可以在我們的控制臺查看錯誤詳情:


Fundebug插件捕獲的錯誤數據如下:

{
    "notifierVersion": "1.5.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
    "locale": "zh-CN",
    "url": "http://localhost:3001",
    "title": "TEST",
    "releaseStage": null,
    "name": "unhandledrejection",
    "time": 1546521929451,
    "message": "hello",
    "type": "unhandledrejection"
}

過濾

如果不需要監(jiān)控unhandledrejection的話,可以通過配置filters來實現:

if ("fundebug" in window) {
    fundebug.filters = [
    {
        message: /^unhandledrejection$/
    }]
}


以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號