{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular/issues/22780","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/22780/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/22780/comments","events_url":"https://api.github.com/repos/angular/angular/issues/22780/events","html_url":"https://github.com/angular/angular/issues/22780","id":305347704,"number":22780,"title":"ngZone.onError.subscribe not working and errorHandler err response missing details!","user":{"login":"karlmnz","id":4446756,"avatar_url":"https://avatars1.githubusercontent.com/u/4446756?v=4","gravatar_id":"","url":"https://api.github.com/users/karlmnz","html_url":"https://github.com/karlmnz","followers_url":"https://api.github.com/users/karlmnz/followers","following_url":"https://api.github.com/users/karlmnz/following{/other_user}","gists_url":"https://api.github.com/users/karlmnz/gists{/gist_id}","starred_url":"https://api.github.com/users/karlmnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlmnz/subscriptions","organizations_url":"https://api.github.com/users/karlmnz/orgs","repos_url":"https://api.github.com/users/karlmnz/repos","events_url":"https://api.github.com/users/karlmnz/events{/privacy}","received_events_url":"https://api.github.com/users/karlmnz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-14T22:12:22Z","updated_at":"2018-03-14T22:12:22Z","closed_at":null,"author_association":"NONE","body":"## I'm submitting a...\r\n<pre><code>\r\n[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[x] Documentation issue or request\r\n</code></pre>\r\n\r\n## Current behavior\r\n[https://angular.io/api/core/NgZone](https://angular.io/api/core/NgZone) indicates can use NgZone.onError to get errors from zone.js, but subscribing to this never catches zone.js errors.  And that ErrorHandle either on individual subscribes e.g. http.get(<url>).subscribe(..., err => {...}) or in a globalErrorHandler does not provide the actual error response. (as per expected behaviour close comment on https://github.com/angular/angular/issues/17012)\r\n\r\n## Expected behavior\r\nErrors in zone.js will be emitted to NgZone.onError so custom angular code can interrogate the actual error response and provide meaningful end user error info.\r\n\r\nOR ErrorHandler err will give the actual status and statusText or message from the zone.js errors.  Zone.js seems to be able to console.error the right message so need to passed back to angular.\r\n\r\n## Minimal reproduction of the problem with instructions\r\nOpen the following plunker, and then view both the result and console.  Not zone.onError.subscribe is never triggered and the http error info is always 'unknown error'.\r\n\r\n[https://plnkr.co/edit/0HjQ98VEEaOHL80XFVG](https://plnkr.co/edit/0HjQ98VEEaOHL80XFVG)\r\n\r\nThe example is a bogus url but same happens for any other errors using HttpClient request e.g. if disconnected network, 401, ...\r\n\r\n## What is the motivation / use case for changing the behavior?\r\nNeed to get the real error status and statusText from the zone.js errors so can conditionally manage the different error types and handle UX flow.  e.g. when make a call to an API with Auth token but is expired, then want to tell the user why, then send to auth login ...  (plus so much more e.g. disconnected network).\r\n\r\n## Environment\r\n\r\n<pre><code>\r\nAngular version: 5.2.8  (this was latest at time)\r\n\r\nBrowser:\r\n- [x] Chrome (desktop) version  64.0.3282.186\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [x] Firefox version 59.0\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [x] IE version 11.0.51\r\n- [x] Edge version (latest)\r\n \r\nFor Tooling issues:\r\n- Node version: v8.9.4\r\n- Platform:  assume all (Mac, Linux, **Windows**)\r\n- Plunker v1.6.2\r\n\r\nOthers:\r\n\r\n</code></pre>\r\n"}}
{"actor":{"display_login":"karlmnz"}}