Let's say I have 3 functions with promises:
function1().then(() => {
function2().then(() => {
function3().then(() => {
})
})
}).catch((err) => {
console.log(err);
})
Would I be able to catch the error returned by any of the 3 functions? If not, what should I do in order to catch the errors returned by any of the functions' promises with one statement?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…