fix(core): Remove duplicate reporting of errors in CDR.detectChanges#60056
Closed
atscott wants to merge 1 commit intoangular:mainfrom
Closed
fix(core): Remove duplicate reporting of errors in CDR.detectChanges#60056atscott wants to merge 1 commit intoangular:mainfrom
CDR.detectChanges#60056atscott wants to merge 1 commit intoangular:mainfrom
Conversation
Contributor
Author
ce1288d to
d018509
Compare
64fc716 to
d018509
Compare
This change removes the reporting of errors from the `ChangeDetectorRef.detectChanges` API. The reporting results in the error being "handled" in two ways, both by reporting to error handler and rethrowing the error. This rethrown error generally ends up being caught further up and again reported to the error handler. The error handler is meant to be for uncaught errors, and since Angular is not at the top of the stack of the call of `CDR.detectChanges`, it does not know what is being done with the rethrown error. Note that for zone-based applications, this will likely have no effect other than removing duplicate reporting of the error. If the rethrown error is not already being caught, it will reach the NgZone's error trap and still be reported to the application `ErrorHandler`.
d018509 to
6036251
Compare
alxhub
approved these changes
Feb 24, 2025
Contributor
|
This PR was merged into the repository by commit 491b0a4. 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 change removes the reporting of errors from the
ChangeDetectorRef.detectChangesAPI. The reporting results in the error being "handled" in two ways, both by reporting to error handler and rethrowing the error. This rethrown error generally ends up being caught further up and again reported to the error handler. The error handler is meant to be for uncaught errors, and since Angular is not at the top of the stack of the call ofCDR.detectChanges, it does not know what is being done with the rethrown error.Note that for zone-based applications, this will likely have no effect other than removing duplicate reporting of the error. If the rethrown error is not already being caught, it will reach the NgZone's error trap and still be reported to the application
ErrorHandler.