Reputation: 790
Is it possible to globally catch exceptions thrown in an Angular 2 application to prevent the entire app from breaking from errors in any one component?
Upvotes: 45
Views: 20698
Reputation: 416
As google explain, you can override error handler service to do what you want. https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html
Upvotes: 40