Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Angular error handling best practices

Angular error handling best practices

#ngKeralam - Angular conference 2022

Pandiyan Murugan

February 01, 2022
Tweet

Other Decks in Technology

Transcript

  1. Backstory of an error • Complexity of application • Communication

    between stakeholders • Developer mistakes • Time pressure • Lack of testing
  2. Catch them all • Angular provides a hook for centralized

    exception handling with ErrorHandler. • However, the default implementation of ErrorHandler only prints error messages to the console. We can modify later.
  3. • Then, we provide it in our root module to

    change default behavior in our application. Instead of using the default ErrorHandler class we are using our class
  4. HttpInterceptor • HttpInterceptor was introduced with Angular 4.3.1. It provides

    a way to intercept HTTP requests and responses to transform or handle them before passing them along. •