This lesson shows how regular control flow statements such as try
/catch
blocks can be used to properly handle errors in asynchronous functions. Oftentimes, the resulting code is easier to read than complex promise chains with .catch()
methods.
const fetch = require('node-fetch')
- does this mean it's only possible server-side?
Funnily it looks like someone has created a github account with the idonotexist username...