提问人:Pooja Kushwah 提问时间:1/7/2023 最后编辑:Pooja Kushwah 更新时间:1/7/2023 访问量:91
抛出警告:承诺被拒绝,无错误:[object Object]
throwing Warning: a promise was rejected with a non-error: [object Object]
问:
function fetch(options) {
return new Promise((resolve, reject) => {
this.request(options, (err, response, status, xhr) => {
console.log('err res', err, response);//#console2
return err ? reject(err) : resolve(response);
});
});
}
这是我的代码块。
我已经看到了很多相关的问题,但仍然找不到任何东西。
就我而言,我从项目中具有相同输入的 2 个位置调用此方法,并且在两次时间(即直到 #console2 一切都相同)都收到相同的错误,但是在返回一次时它会引发警告,对于另一个调用,它没有抛出任何东西。
如果有人知道这个问题,请告诉我。
提前致谢:)。fetch
promise was rejected with a non-error:
答: 暂无答案
评论