easyStudy question · answer published in Node.js interview questions, so no pointsjavascriptasync-awaiterror-handling
try/catch around an async call
Running this in Node.js, what happens?
async function load() {
throw new Error('boom')
}
try {
load()
} catch (e) {
console.log('caught')
}
console.log('done')Discussion 0
Join free to post in the discussion.
Related questions
- fetch and error status codesFull Stack Developer
- Timer vs promise orderFull Stack Developer
- map with an async callbackFull Stack Developer
- Dates sent through JSONFull Stack Developer
- One failing widget breaks the dashboardFull Stack Developer
- Three awaits, three times slowerFull Stack Developer
- Returning form validation errorsFull Stack Developer
- error.tsx must be a Client ComponentFull Stack Developer