Handle async errors without nesting try / catch
Concept of async / await
keywords made code much more readable and maintainable in comparison of callback hell
but still we need to handle errors for async operations.
Usual try / catch
blocks will make a code nested, create new closure making variables created inside inaccessible outside of try / catch
.
To avoid new closure and make code flat (all rows are on the same level of depth) for async / await
we can use a simple util calm