Question
What happens if an error is thrown by an 'await' operation and not caught?
Asked by: USER6433
74 Viewed
74 Answers
Answer (74)
If an error is thrown by an 'await' operation and not caught by a 'try...catch' block, it will typically result in an unhandled rejection. In Node.js, this might lead to the process crashing unless specific global error handlers are set up. In browsers, it might manifest as an uncaught error in the developer console.