function1() outputs:
a
d
b
What I would like is that if function2 errors, to not return to function1, and leave the output at:
a
d
Is this possible? I'm thinking I could reference a returned boolean (errored or not) in a finally block, but I'm wondering if there is a better solution.
function1(){
try {
console.log("a");
function2();
console.log("b");
} catch (e){
console.log("c");
}
}
function2(){
try {
if(...) throw new Error();
} catch (e){
console.log("d");
}
}