![Handling errors with async/await and promises](https://i.comentr.com/kx39MPIibq9Ny2UqESeaVclWVM0_tam.jpg)
Handling errors with async/await and promises
https://medium.com/@cvitullo/handling-errors-with-async-await-and-promises-cd2fea534f08
I love promises. They’re a fantastic model for asynchronous behavior, and await makes it very easy to avoid callback hell (though I'd argue promises do a great job of that on their own). Once you can build a mental model for how promises work, you can build some very complex asynchronous flows in a handful of lines of code.
As much as I love having async/await in my toolbox, there are several quirks to handling errors when using it. It’s very easy to write error handling in a way that it swallows more errors than you want, and strategies to work around that negate some of the readability advantages that async/await brings.
Handling errors with async/await and promises
Jul 25, 2018, 11:34am UTC
https://medium.com/@cvitullo/handling-errors-with-async-await-and-promises-cd2fea534f08
> I love promises. They’re a fantastic model for asynchronous behavior, and await makes it very easy to avoid callback hell (though I'd argue promises do a great job of that on their own). Once you can build a mental model for how promises work, you can build some very complex asynchronous flows in a handful of lines of code.
> As much as I love having async/await in my toolbox, there are several quirks to handling errors when using it. It’s very easy to write error handling in a way that it swallows more errors than you want, and strategies to work around that negate some of the readability advantages that async/await brings.