Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(core): Surface errors from ApplicationRef.tick to callsite #60102

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

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Feb 25, 2025

This commit ensures that errors during ApplicationRef.tick are surfaced to the callsite rather than being caught and reported to the ErrorHandler.

The current catch and report approach was originally added in e263e19 with the goal of preventing automatic change detection crashes due to the error happening in the subscription. However, this results in hiding a public API that can hide errors. Callers cannot assume that the tick was successful and perform follow-up work.

This change now surfaces errors and adds the error handling directly to the callsites.

BREAKING CHANGE: ApplicationRef.tick will no longer catch and report errors to the appplication ErrorHandler. Errors will instead be thrown out of the method and will allow callers to determine how to handle these errors, such as aborting follow-up work or reporting the error and continuing.

@atscott atscott added target: major This PR is targeted for the next major release requires: TGP This PR requires a passing TGP before merging is allowed labels Feb 25, 2025
@atscott atscott requested a review from alxhub February 25, 2025 20:47
@pullapprove pullapprove bot removed the requires: TGP This PR requires a passing TGP before merging is allowed label Feb 25, 2025
@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change area: core Issues related to the framework runtime labels Feb 25, 2025
@ngbot ngbot bot added this to the Backlog milestone Feb 25, 2025
@atscott atscott force-pushed the appreftickerrors branch 2 times, most recently from c290b03 to 644c63d Compare March 4, 2025 19:30
This commit ensures that errors during `ApplicationRef.tick` are
surfaced to the callsite rather than being caught and reported to the
`ErrorHandler`.

The current catch and report approach was originally
added in angular@e263e19
with the goal of preventing automatic change detection crashes due to
the error happening in the subscription. However, this results in hiding
a public API that can hide errors. Callers cannot assume that the tick
was successful and perform follow-up work.

This change now surfaces errors and adds the error handling directly to
the callsites.

BREAKING CHANGE: `ApplicationRef.tick` will no longer catch and report
errors to the appplication `ErrorHandler`. Errors will instead be thrown out of
the method and will allow callers to determine how to handle these
errors, such as aborting follow-up work or reporting the error and
continuing.
@atscott atscott force-pushed the appreftickerrors branch from 644c63d to b74e3b8 Compare March 5, 2025 19:44
@atscott
Copy link
Contributor Author

atscott commented Mar 7, 2025

Green TGP

@atscott atscott added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Mar 7, 2025
@atscott
Copy link
Contributor Author

atscott commented Mar 7, 2025

caretaker note: please merge and sync on its own. Though there is a green TGP, due to the nature of the change, it would be best to have this in an isolated CL.

@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 338818c.

The changes were merged into the following branches: main

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime detected: breaking change PR contains a commit with a breaking change merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants