Photo by Nathan Dumlao on Unsplash

Expecting the Unexpected — Best practices for Error handling in Angular

Centralize error handling, track errors, and notify about them

Michael Karén
Published in
7 min readJan 29, 2019

--

In this article, I write about centralizing Angular error handling. I discuss some of the more common topics such as:

  • client-side errors
  • server-side errors
  • user notification
  • tracking errors

I present some code snippets during the way and lastly provide a link to the full example.

Spanish version:

Whom should we blame for errors?

Why do we have errors in our applications? Why can’t we write code from specifications that always works?

Ultimately, human beings create software, and we are prone to make mistakes. Some reasons behind errors could be:

  1. Complexity of application
  2. Communication between stakeholders
  3. Developer mistakes
  4. Time pressure
  5. Lack of testing

--

--

Michael Karén
Angular In Depth

Frontend Architect • JavaScript Enthusiast • Educative.io Author • ngVikings organizer.