wx.onUnhandledRejection不生效
wx.onUnhandledRejection((reason)=>{
console.log('promise报错121212',reason)
})
testPormise() {
return new Promise((resolve,reject)=>{
console.log(bb);
const aa = 'name';
if (aa === 'name1') {
resolve();
} else {
reject({message: '1212'});
}
});
},
this.testPormise().then(()=>{});
https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html 这样尝试并没有打印出来reason