📅  最后修改于: 2022-03-11 15:03:39.530000             🧑  作者: Mango
// errors that occur in asynchronous code inside promises cannot be caught with regular try/catch
// you need to pass the error handler into `.catch()`
fetchUserData(userId).then(console.log).catch(handleError);