What is the right way for error handing in Function inside sub function?

后端 未结 0 1454
感情败类
感情败类 2021-01-02 15:43

what is the best practice for error handling?

1st way:-

async mainFunction() {
 try {
  await subFunction();
 }catch (err){
  console.log(err);
 }
}
as         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题