A Guide to Proper Error Handling in JavaScript

0
5
views

Ah, the perils of error handling in JavaScript. If you believe Murphy’s law, anything that can go wrong, will go wrong. In this article, I would like to explore error handling in JavaScript. I will cover pitfalls, good practices, and finish with asynchronous code and Ajax. This popular article was updated on 08.06.2017 to address reader feedback. Specifically, file names were added to snippets, unit tests were cleaned up, wrapper pattern was added to uglyHandler, sections on CORS and 3rd party error handlers were added. I feel JavaScript’s event-driven paradigm adds richness to the language. I like to imagine the…
A Guide to Proper Error Handling in JavaScript