-
Book Overview & Buying
-
Table Of Contents
Learning Angular - Fifth Edition
By :
The most common runtime errors in an Angular application come from the interaction with an HTTP API. Entering the wrong login credentials or sending data in the wrong format can result in an HTTP error. An Angular application can handle HTTP errors in the following ways:
In the following section, we will explore how to handle an HTTP error in a specific HTTP request.
Handling errors in HTTP requests typically requires manually inspecting the information returned in the error response object. RxJS provides the catchError operator to simplify that. It can catch potential errors when initiating an HTTP request with the pipe operator.
You will need the source code of the Angular application we created in Chapter 10, Collecting User...