From the course: Angular: Testing and Debugging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Error handling in Angular

Error handling in Angular - Angular Tutorial

From the course: Angular: Testing and Debugging

Start my 1-month free trial

Error handling in Angular

- [Instructor] In Angular, all errors pass through the ErrorHandler class. This class is part of the angular/core module and its job is to essentially write errors to the console. Most errors in Angular happen because of missing import or export statements, forgotten declarations in a decorator, such as providers or selectors, no instance of imported class, or issues related to asynchronous actions, like errors from a promise or observable. Think of observables as a type of promise, but for data that returns more than once. This sequence of data is called a "stream" and Angular is built from the ground up to work with these streams. While streams are excellent for high performance applications, they return cryptic error messages that are difficult to diagnose. This is because Angular executes all code inside of things called zones. We'll looking at zones in detail in the next video but, for now, think of them as scoped containers, called execution contexts. These containers group…

Contents