How to write clean, asynchronous code with error handling in a beautiful way

Image for post
Image for post
Photo by Jordan Rowland on Unsplash

We may still consider JavaScript as a legacy language from the ‘90s, but it’s ruling as the coolest kid on the block.

On the one hand, it is important to handle errors, otherwise users will hit a wall where they can’t amend their inputed data and have no idea what’s going on because the error messages are very vague.

On the other hand, having a huge codebase with a lot of conditionals and error objects going everywhere like wild animals is not desirable for the development team.

But let’s be honest, handling every possible error is hard.

So, here in this blog post, I will show you some ways of handling asynchronous errors in JavaScript efficiently. …

About

Patricio López Juri

Software Engineer from Chile. Vinyl record collector.

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