Hacker News new | past | comments | ask | show | jobs | submit login

Try/catch is not async and exceptions do not bubble up through the async context, which makes sense as the caller moved on with execution. Try this in your console:

    try {
        console.log("see, ");
        setTimeout(() => {throw new Error("oops")}, 100);
        console.log(
            "I can't assume here that"
            + " the prev. line succeeded"
        );
    } catch(e) {
        console.log("error!");
    }



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: