Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(service-worker): Add to ErrorHandler that the error is from SW
With Angular v11.0.4 and commit [_fix(service-worker): handle error with ErrorHandler_](552419d) Angular start to send all service worker registration errors to the Angular standard `ErrorHandler.handleError()` interface, instead of logging them in the console. But service worker registration errors are a lot different than other code errors: - They are frequent, for example, they happen a lot with Chrome v84, Chrome v85, Firefox 84, and Samsung Internet v13. - Most applications can run even without a registered service worker. Use case example: - All errors send to `ErrorHandler.handleError()` show a `window.confirm` pop-up, so developers see the error right away during development, and users of the application have a huge error message before trying to use a broken application. - All errors from service worker registration are ignored, so users are not annoyed in that case. With the actual code, inside `ErrorHandler.handleError()`, we can't differentiate a service worker registration error from any other error, and service worker registration errors are already not clear at all, so we are losing a valuable piece of information. I propose to add a "source" of the error, like that service worker registration errors are cachable inside `ErrorHandler.handleError()`.
- Loading branch information