Unfortunately, errors happen in every application which makes error handling in angular apps one of the most critical parts you have to focus on. Yes, we can't get rid of errors completely, however, we can react to them and gracefully handle exceptions improving the user experience in our apps. In this video, I will share with you different error handling strategies in Angular that will help you to solve 80% of possible scenarios that might occur in your angular applications. You will learn how to handle exceptions that happen in sync and async code, how Angular tracks errors, and how it globally handles it. You will see how errors are being handled by rxjs streams and how to use Angular HTTP_INTERCEPTORS to implement a global strategy for failed HTTP requests.
💥 Angular courses made by Dmytro - [ Ссылка ] 💥
✂️ Use coupon YOUTUBE_DISCOUNT to get a 10%-off discount ✂️
🕒 Time Codes:
00:00:00 - Intro & What you will learn;
00:01:36 - Project overview;
00:04:18 - Using try/catch to handle errors in sync code;
00:06:23 - (optional) Why would we need global error handling;
00:07:19 - How works built-in Angular Global Error Handler;
00:09:30 - Implementing Global Error Handler;
00:15:12 - Why do we need to rethrow exceptions?
00:17:11 - try/catch, Angular and async code;
00:18:06 - What happens under the hood?
00:22:33 - Error handling in RxJS Observables;
00:31:11 - Global HTTP Error Handling;
00:38:10 -Bonus: Error flow vs Data Flow in RxJs;
00:40:24 - Outro;
🔗 Source code on GitHub (init state on the master branch):
[ Ссылка ]
💡 Short Frontend Snacks (Tips) every week here:
Twitter - [ Ссылка ]
Instagram - [ Ссылка ]
LinkedIn - [ Ссылка ]
Error Handling in Angular - Complete Guide (2022)
Теги
error handling in angularerror handling in angular 14error handling in angular 13error handling in angular 12angular error handling best practicesangular error handlingangular error interceptorangular global error handler interceptorangular global error handlerangular error handling interceptorangular error message displayrxjs error handlingangular rxjs error handlingrxjs catch errorangular service error handlingAngular tutorial