0

I have a 12 async functions, all functions should get executed one after another and throw if there is any error.

async function fun1(){
...
}

async function fun2(){
...
}
async function fun3(){
...
}

async function executeAll() {
try{
  await fun1();
  await fun2();
  await fun3();
  } catch(e){
console.error(e)
}
}

It is not returning any error. Is there any way handling of individual errors with try/catch. functions ? or any other.

1
  • The question is not clear. Are one of these functions actually throwing an error and you can't see it? Commented Aug 1, 2020 at 20:41

1 Answer 1

1

I think it is. You can also catch errors in promise

     executeAll.then((result)=>{
          //some code
     }).catch((err)=>{
         //handling error
     })
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.