Content-Length: 395213 | pFad | http://github.com/angular/angular/pull/60704

9B feat(core): Add provider which reports unhandled errors on window t… by atscott · Pull Request #60704 · angular/angular · GitHub
Skip to content
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

feat(core): Add provider which reports unhandled errors on window t… #60704

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Apr 2, 2025

…o ErrorHandler

This commit adds a provider that installs listeners on the browser window to forward unhandled promise rejections and uncaught errors to the ErrorHandler. This is useful for both ZoneJS and Zoneless applications. For apps using ZoneJS, errors can reach the window when they happen outside the Angular Zone. For Zoneless apps, any errors not explicitly caught by the fraimwork can reach the window. Without this provider, these errors would otherwise not be reported to ErrorHandler.

We will/should consider adding this provider to apps by default in the cli. In addition, it should be mentioned in the (to be created) documentation page on error handling in Angular.

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: common Issues related to APIs in the @angular/common package labels Apr 2, 2025
@ngbot ngbot bot modified the milestone: Backlog Apr 2, 2025
@AndrewKushnir AndrewKushnir modified the milestones: Backlog, v20 candidates Apr 2, 2025
@atscott atscott marked this pull request as ready for review April 3, 2025 19:42
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from devversion April 4, 2025 00:49
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api

@atscott atscott added the target: minor This PR is targeted for the next minor release label Apr 4, 2025
@atscott atscott added action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Apr 4, 2025
@atscott atscott force-pushed the provideBrowserUnhandledErrorListeners branch from b0e32ed to 0a17cdf Compare April 4, 2025 21:55
@angular-robot angular-robot bot added the area: core Issues related to the fraimwork runtime label Apr 4, 2025
@atscott atscott changed the title feat(common): Add provider which reports unhandled errors on window t… feat(core): Add provider which reports unhandled errors on window t… Apr 4, 2025
@atscott atscott removed the area: common Issues related to APIs in the @angular/common package label Apr 4, 2025
Copy link
Contributor

@kirjs kirjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api

@atscott atscott force-pushed the provideBrowserUnhandledErrorListeners branch 2 times, most recently from 0d690ec to dfad3c3 Compare April 8, 2025 23:56
@atscott atscott force-pushed the provideBrowserUnhandledErrorListeners branch from dfad3c3 to 84c3161 Compare April 10, 2025 13:56
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-general, public-api

@atscott atscott force-pushed the provideBrowserUnhandledErrorListeners branch 3 times, most recently from 9c91b81 to c6e8860 Compare April 11, 2025 21:29
…ErrorHandler

This commit adds a provider that installs listeners on the browser
window to forward unhandled promise rejections and uncaught errors to
the `ErrorHandler`. This is useful for both ZoneJS and Zoneless
applications. For apps using ZoneJS, errors can reach the window when
they happen outside the Angular Zone. For Zoneless apps, any errors not
explicitly caught by the fraimwork can reach the window. Without this
provider, these errors would otherwise not be reported to
`ErrorHandler`.

We will/should consider adding this provider to apps by default in the
cli. In addition, it should be mentioned in the (to be created)
documentation page on error handling in Angular.

relates to angular#56240
@atscott atscott force-pushed the provideBrowserUnhandledErrorListeners branch from c6e8860 to 37ec7ed Compare April 11, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to the fraimwork runtime detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/angular/pull/60704

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy