Async await without try catch in JavaScript

Sai Umesh Dhanewar
Nov 3, 2017 · 1 min read

Before introduction to async await my typical code used to look like below.

If your using Express framework you would be interested in this article

https://medium.com/tech-buddy/handling-errors-in-express-gracefully-4bf289ddf9a1

on introduction of async await the same code can be written as following.

if you are not fan of try catch just like me or just want to avoid using them then you can write same code as below.

if you wish to know which specific function caused error with some error code(which helps in debugging in greater extent).

Thanks for Reading and Happy Coding.

Tech Buddy

A good place to keep up with the recent technology updates

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store