As per Angular's best practices, we shouldn't be using the ErrorHandler class for global error handling of application errors. Instead, we should handle application-level errors at the individual call sites and use ErrorHandler only for fatal error reporting.
This change would involve:
Aside from best practices, this change should have a few major benefits for the whole application, including:
- Potentially drastically reducing our initial bundle size
- Making it possible to migrate to zoneless (which is currently in developer preview)
As per Angular's best practices, we shouldn't be using the
ErrorHandlerclass for global error handling of application errors. Instead, we should handle application-level errors at the individual call sites and useErrorHandleronly for fatal error reporting.This change would involve:
GlobalErrorHandlerclassprovideBrowserGlobalErrorListeners()to theApplicationConfigAside from best practices, this change should have a few major benefits for the whole application, including: