DEV Community

Discussion on: Async + Await refactor, which do you like best?

Collapse
 
qm3ster profile image
Mihail Malo

I often do the following:

await fallible().catch(errorHandler)

It allows me to pipe/sidechain my errors where they truly belong, instead of breaking up my happy path logic with inline implementation of the catch block OR lambda.
If I need to abort the current function, the handler will just rethrow.