René's URL Explorer Experiment


Title: new behavior for global ErrorHandler and uncaught errors from promises · Issue #27840 · angular/angular · GitHub

Open Graph Title: new behavior for global ErrorHandler and uncaught errors from promises · Issue #27840 · angular/angular

X Title: new behavior for global ErrorHandler and uncaught errors from promises · Issue #27840 · angular/angular

Description: 🐞 bug report Affected Package Well I thought this was zone.js wrapping the errors, but I rolled zone back only zone and it didn't change. Is this a regression? Yes, the previous version in which this bug was not present was 5.x Descripti...

Open Graph Description: 🐞 bug report Affected Package Well I thought this was zone.js wrapping the errors, but I rolled zone back only zone and it didn't change. Is this a regression? Yes, the previous version in which th...

X Description: 🐞 bug report Affected Package Well I thought this was zone.js wrapping the errors, but I rolled zone back only zone and it didn't change. Is this a regression? Yes, the previous version in whic...

Opengraph URL: https://github.com/angular/angular/issues/27840

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"new behavior for global ErrorHandler and uncaught errors from promises","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄\r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\n\u003c!-- ✍️edit: --> Well I thought this was zone.js wrapping the errors, but I rolled zone back only zone and it didn't change.\r\n\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\n\u003c!-- ✍️--> Yes, the previous version in which this bug was not present was 5.x\r\n\r\n### Description\r\n\r\n\u003c!-- ✍️-->\r\n\r\nPreviously, unhandled errors from promises were handed to a custom error handler unchanged.  But now, it seems the error is wrapped and you need to unwrap it to get the real error that's sitting on the \"rejection\" property of the error.\r\n\r\nThe docs make no mention of this here https://angular.io/api/core/ErrorHandler and neither does any googling surprisingly.\r\n\r\nI noticed this only after upgrading from angular 5 to angular 7 and one of my e2e tests that relied on my general error handler started failing.\r\n\r\nThe only workaround I found was to have something like this at the top of the error handler's handleError() method like this:\r\n\r\n```typescript\r\n    while(error.rejection) {\r\n      error = error.rejection;\r\n    }\r\n\r\n```\r\nbut...\r\n\r\n1. I'm quite sure there's a better way - now I have to type error as any\r\n2. I'm not sure if there are any other situations that will require unwrapping (e.g. from observables?).\r\n\r\nEither way, if this was some kind of intentional feature, it's definitely a gotcha that I think should be mentioned (with the RIGHT way to handle it) in the doc link I pasted.\r\n\r\n## 🔬 Minimal Reproduction\r\n\u003c!--\r\nPlease create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-issue-repro2\r\n-->\r\n\u003c!-- ✍️--> \r\n\r\n1. follow the docs and implement a global error handler and try to handle unhandled requests uniformly - something like this:\r\n\r\n```typescript\r\n@Injectable()\r\nexport class SpiffyErrorHandlerService implements ErrorHandler {\r\n  constructor(private injector: Injector, private snackBar: MatSnackBar) {}\r\n  public handleError(error: Error) {\r\n    if (error instanceof HttpErrorResponse) {\r\n      if (error.status === 401) {\r\n        this.snackBar.open(\r\n          'Oops.  It looks like you tried to access a logged-in resource while logged out.  Please log in again.',\r\n          '',\r\n          { duration: 3000 }\r\n        );\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n2. inject HttpClient\r\n\r\n3. await this.http.get('/some-404-returning-url').toPromise();\r\n\r\n\u003c!--\r\nIf StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.\r\n\r\nIssues that don't have enough info and can't be reproduced will be closed.\r\n\r\nYou can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue\r\n-->\r\n\r\n## 🔥 Exception or Error\r\n\r\nEXPECTED: error handler works, gets the HttpErrorResponse, and shows the snackbar\r\nACTUAL: the HttpErrorResponse is on error.rejection instead of right on error.\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\n\u003c!-- run `ng version` and paste output below -->\r\n\u003c!-- ✍️-->\r\n\r\nAngular CLI: 7.1.2\r\nNode: 10.14.2\r\nOS: linux x64\r\nAngular: 7.1.3\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router, service-worker\r\n\r\nPackage                           Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect         0.10.7\r\n@angular-devkit/build-angular     0.10.7\r\n@angular-devkit/build-optimizer   0.10.7\r\n@angular-devkit/build-webpack     0.10.7\r\n@angular-devkit/core              7.0.7\r\n@angular-devkit/schematics        7.1.2\r\n@angular/cdk                      7.1.1\r\n@angular/cli                      7.1.2\r\n@angular/flex-layout              7.0.0-beta.19\r\n@angular/material                 7.1.1\r\n@ngtools/webpack                  7.0.7\r\n@schematics/angular               7.1.2\r\n@schematics/update                0.11.2\r\nrxjs                              6.3.3\r\ntypescript                        3.1.6\r\nwebpack                           4.19.1\r\n    \r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\u003c!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->\r\n\r\n\u003c!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->\r\n","author":{"url":"https://github.com/trycatchal","@type":"Person","name":"trycatchal"},"datePublished":"2018-12-26T21:47:22Z","url":"https://github.com/angular/angular/issues/27840"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4b4c76f7-95de-226a-5a0f-5df7d3ef1aae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC52:28815B:1901EB8:2134CDB:6B014BC9
html-safe-noncee318f12b6d9320a3e4fa2729104b3f45cad8cff37233b67c7bdc4eaa9c06ac86
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzUyOjI4ODE1QjoxOTAxRUI4OjIxMzRDREI6NkIwMTRCQzkiLCJ2aXNpdG9yX2lkIjoiODY2NDc3NjcyMjUwNTM1NDE4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac999edc8d87bd10f29dc1347f8fb90fa2a22adcfb70302b0225005da78f4d4aa5
hovercard-subject-tagissue:394246781
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/27840/issue_layout
twitter:imagehttps://opengraph.githubassets.com/246720fcf11bbf6a02b00a675f0c003021878e3cd6883ae46afcaef7232b7dd9/angular/angular/issues/27840
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/246720fcf11bbf6a02b00a675f0c003021878e3cd6883ae46afcaef7232b7dd9/angular/angular/issues/27840
og:image:alt🐞 bug report Affected Package Well I thought this was zone.js wrapping the errors, but I rolled zone back only zone and it didn't change. Is this a regression? Yes, the previous version in which th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametrycatchal
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/27840#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F27840
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F27840
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/27840
Reloadhttps://github.com/angular/angular/issues/27840
Reloadhttps://github.com/angular/angular/issues/27840
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/27840
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/27840
new behavior for global ErrorHandler and uncaught errors from promiseshttps://github.com/angular/angular/issues/27840#top
https://github.com/JiaLiPassion
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
core: error handlinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20error%20handling%22
freq1: lowhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/trycatchal
trycatchalhttps://github.com/trycatchal
on Dec 26, 2018https://github.com/angular/angular/issues/27840#issue-394246781
https://angular.io/api/core/ErrorHandlerhttps://angular.io/api/core/ErrorHandler
Nexthttps://github.com/angular/angular/issues/27840?timeline_page=1
benleshhttps://github.com/benlesh
area: commonIssues related to APIs in the @angular/common packagehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20common%22
comp: mischttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20misc%22
on Dec 28, 2018https://github.com/angular/angular/issues/27840#event-2046608961
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Dec 28, 2018https://github.com/angular/angular/issues/27840#event-2046608978
https://github.com/mhagnumdw
mhagnumdwhttps://github.com/mhagnumdw
on Jan 3, 2019https://github.com/angular/angular/issues/27840#issuecomment-451300141
Resolvehttps://angular.io/guide/router#resolve-pre-fetching-component-data
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
area: commonIssues related to APIs in the @angular/common packagehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20common%22
comp: mischttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20misc%22
on Mar 8, 2019https://github.com/angular/angular/issues/27840#event-2190326042
benleshhttps://github.com/benlesh
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
on May 9, 2019https://github.com/angular/angular/issues/27840#event-2331648563
https://github.com/benlesh
benleshhttps://github.com/benlesh
on May 9, 2019https://github.com/angular/angular/issues/27840#issuecomment-491093200
small stackblitz reprohttps://stackblitz.com/edit/angular-nzpgjm
benleshhttps://github.com/benlesh
JiaLiPassionhttps://github.com/JiaLiPassion
on May 9, 2019https://github.com/angular/angular/issues/27840#event-2331652679
https://github.com/JiaLiPassion
JiaLiPassionhttps://github.com/JiaLiPassion
on Jun 11, 2019https://github.com/angular/angular/issues/27840#issuecomment-500989671
https://github.com/JiaLiPassion
JiaLiPassionhttps://github.com/JiaLiPassion
on Mar 5, 2020https://github.com/angular/angular/issues/27840#issuecomment-595224289
AndrewKushnirhttps://github.com/AndrewKushnir
on Mar 12, 2020https://github.com/angular/angular/issues/27840#event-3124228463
feat(zone.js): add a zone config to allow user disable wrapping uncau…https://github.com/AndrewKushnir/angular/commit/99de6f22c86204aab2925e404e7387ed0aff64b0
https://docs.github.com/articles/closing-issues-via-commit-messages
99de6f2https://github.com/AndrewKushnir/angular/commit/99de6f22c86204aab2925e404e7387ed0aff64b0
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
core: error handlinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20error%20handling%22
on Mar 16, 2020https://github.com/angular/angular/issues/27840#event-3132403714
AndrewKushnirhttps://github.com/AndrewKushnir
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
8456c5ehttps://github.com/angular/angular/commit/8456c5ec60a3fb424c569b36bf4705afc5fc9597
on Mar 16, 2020https://github.com/angular/angular/issues/27840#event-3133871166
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Apr 16, 2020https://github.com/angular/angular/issues/27840#issuecomment-614745633
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Apr 16, 2020https://github.com/angular/angular/issues/27840#event-3240672464
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/27840
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/27840
JiaLiPassionhttps://github.com/JiaLiPassion
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
core: error handlinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20error%20handling%22
freq1: lowhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.