Skip to content

让 await 永远不要抛出错误

javascript
// 这样的话,请求失败也不会抛错
const result = await request().catch((e) => {
  return e;
});
Comments
  • Latest
  • Oldest
  • Hottest
No comment yet.
Powered by Waline v3.5.6

Views 1328 , Visitors 864
Released under the MIT License.