普通error错误可以用这个方法监听到:
1、web:window.onerror = function(message, url, line, ceil, error) {console.log(“错误” + message)}
2、native:(jsb).onError(function(location, message, stack) {console.log(“错误” + message)}
promise请求错误不知道怎么写,尝试过这个方法无效:
window.onunhandledrejection = function(err){console.log(“错误” + err)}
jsb下也没有 onunhandledrejection 这样一个方法
搜索论坛好多开发者问这个问题