async function myFunction() {
  try {
         await somethingThatReturnsAPromise();
    }  catch (err) {
       console.log(err)  
    }  
}




async function myFunction() {
  await somethingThatReturnsAPromise().catch(function(err){console.log(err);})  
    
}

  

相关文章:

  • 2022-12-23
  • 2021-03-27
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2021-06-04
  • 2021-08-31
  • 2022-01-23
相关资源
相似解决方案