Exception Handling in Angular Application


Exception-Handling-in-Angular

Errors, Exceptions, CallStack and Angular

This article shows how to handle server errors as well as client errors in an Angular application. There are multiple type of errors which can from either server side i.e. from your API or on client side i.e. in your Angular application itself. We need to handle those errors in our application otherwise our application would be crashed. As a general rule, I think this kind of errors need a notification; a clear message explaining to the user what is happening and how to proceed. Type of errors are described below -

  • Server and connection errors

    Server and connection errors affect in the way the app communicates with the server. If the app is not online, the resource doesn’t exist (404), the user is not allowed to access the data (403)… HttpClient will give us an informative Error that we have to handle, but our app won’t crash and the risk of data corruption or lost can be managed.

  • Client errors

    Client errors seem more dangerous. They could completely crash our app, originate corrupt data that could be stored in the server, keep the user working on stuff that wouldn’t be saved.

You can find the original source of this post after clicking on read more button.

No comments:

Post a Comment