fix(core): Surface errors from ApplicationRef.tick
to callsite
#60102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit ensures that errors during
ApplicationRef.tick
are surfaced to the callsite rather than being caught and reported to theErrorHandler
.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 appplicationErrorHandler
. 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.