我正在尝试让异步等待在没有 try/catch 的情况下工作
return await fetch(url, options)
.then(res => res.json())
.catch(err => {
throw new Error(err)
})
这是我拨打电话的方式:
const response = await makeApiRequest('/reset', {
password: password1,
code
}, {
noauth: true
}).catch(err => {
debugger;
msg = err.message;
});
if (response) {
navigateTo('/');
}
问题是没有一个 catch 块在工作。该代码已过期并提供 401。
绝地无双
收到一只叮咚
相关分类