Loading topic
HttpClient request can go wrong. Later chapters use that map for catchError, retries and interceptors.2 min readHttpClient, and that you know what an Observable is and how pipe() works. It covers the object that HttpClient gives you when a request fails.2 min readHttpClient, use pipe() on Observables, and read the fields of an HttpErrorResponse. Here you will sort failures into three categories. The categories matter because each one calls for a different reaction.2 min readpipe(). You should also have made requests with HttpClient and seen what an HttpErrorResponse contains. Here you will use catchError to turn a failed request into something your callers can use.2 min readUserService from the previous chapter. Its getUser method returns an Observable<User> that fails with an Error carrying a readable message. Here you will show that message in the UI.2 min readHttpClient, you know what pipe() does, and you have seen catchError and HttpErrorResponse in the earlier chapters. Here you add the RxJS retry operator so a failed request is sent again before the caller sees an error.2 min readHttpClient request, use catchError, and know the retry operator from the previous chapter. Here you decide when a retry is a good idea and when it does harm.2 min readpipe(), and how to make requests with HttpClient. You should also have met the retry operator and the idea of retrying only safe, transient failures.2 min readHttpClient, and that you know pipe(), tap and catchError from RxJS. It shows where cross-cutting HTTP logic belongs, so the retry and error policies in later chapters need no changes in individual services.2 min readcatchError handler and use the retry operator on an HttpClient call. It also assumes you know what an HttpErrorResponse is. Here you move the retry policy out of individual services and into one functional interceptor.2 min readHttpClient, use catchError and retry, and register a functional interceptor with withInterceptors. If any of these are unfamiliar, review the earlier chapters first.2 min readHttpClient, and that you know catchError and provideHttpClient. Earlier chapters handled errors where a request was made. Here you add a safety net for errors that nothing else handled.2 min readHttpClient. It also assumes you know catchError and retry, and that you have read the chapter on the retry interceptor. Here you will test the error mapping and the retry behavior without a real server.1 min readcatchError, functional interceptors registered with withInterceptors, and the difference between HttpErrorResponse status codes. You will build one interceptor that attaches an access token, reacts to a 401, refreshes the token once, and replays the failed request2 min read