Level 1M11Lesson 11.5

beginner38 minby DevFox

Errors in async code: try around await

Learn the third state of a promise, rejected, and what await does when the wait goes wrong: it throws the reason on its own line. Make a promise that is rejected, catch its error with try and catch around await, see that a throw in an async function rejects its promise, and find out why a try without await catches nothing.

  • Fundamentals
  • TypeScript
Errors in async code: `try` around `await`. Read this lesson at .