I'm stuck with the following problem:
function upperFn(){
FetchSomeThing()
.catch(err => {
console.log(err)
})
}
function lowerFn(){
try {
upperFn()
}
catch (err){
//Here its not working anymore
console.log(err) // Catch is never used
}
}
So I've tried to return the error and even rethrow it but nothing work's. I would be very happy if someone can explain me how to catch this error in my lower function.
Thanks

upperFnreturn the promise, and then handle the promise rejection. You cannot handle asynchronous errors with a synchronoustry/catch.