-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix(common): Handle errors in async pipe subscriptions #60057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`AsyncPipe` would previously promise rejections unhandled and subscription errors uncaught. This is more or less fine in a Zone-based application because errors inside the Angular Zone are caught be the Zone's error trap and reported to `ErrorHandler`. However, in zoneless applications, these errors are never caught or reported by the FW and can reach the node process in SSR and cause it to shut down. BREAKING CHANGE: `AsyncPipe` now directly catches unhandled errors in subscriptions and promises and reports them to the application's `ErrorHandler`. For Zone-based applications, these errors would have been caught by ZoneJS and reported to `ErrorHandler` so the result is generally the same. The change to the exact mechanism for reporting can result in differences in test environments that will require test updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good (I've looked at it earlier as well) 👍
It'd be helpful if @alxhub takes a look as well when he has a chance.
removing the |
actually I see TGP passed for the same snapshot, I think this just got caught up in yesterday's TAP breakage. Adding back the label, I believe this is safe to merge |
This PR was merged into the repository by commit 739cada. The changes were merged into the following branches: main |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
AsyncPipe
would previously promise rejections unhandled and subscription errors uncaught. This is more or less fine in a Zone-based application because errors inside the Angular Zone are caught be the Zone's error trap and reported toErrorHandler
. However, in zoneless applications, these errors are never caught or reported by the FW and can reach the node process in SSR and cause it to shut down.BREAKING CHANGE:
AsyncPipe
now directly catches unhandled errors in subscriptions and promises and reports them to the application'sErrorHandler
. For Zone-based applications, these errors would have been caught by ZoneJS and reported toErrorHandler
so the result is generally the same. The change to the exact mechanism for reporting can result in differences in test environments that will require test updates.