{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular/issues/22516","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/22516/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/22516/comments","events_url":"https://api.github.com/repos/angular/angular/issues/22516/events","html_url":"https://github.com/angular/angular/issues/22516","id":301348562,"number":22516,"title":"HttpClient.post pushes undefined down the observable stream on error","user":{"login":"abdullahsari","id":24608797,"avatar_url":"https://avatars1.githubusercontent.com/u/24608797?v=4","gravatar_id":"","url":"https://api.github.com/users/abdullahsari","html_url":"https://github.com/abdullahsari","followers_url":"https://api.github.com/users/abdullahsari/followers","following_url":"https://api.github.com/users/abdullahsari/following{/other_user}","gists_url":"https://api.github.com/users/abdullahsari/gists{/gist_id}","starred_url":"https://api.github.com/users/abdullahsari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdullahsari/subscriptions","organizations_url":"https://api.github.com/users/abdullahsari/orgs","repos_url":"https://api.github.com/users/abdullahsari/repos","events_url":"https://api.github.com/users/abdullahsari/events{/privacy}","received_events_url":"https://api.github.com/users/abdullahsari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-01T10:17:08Z","updated_at":"2018-03-01T10:17:08Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n<!-- Check one of the following options with \"x\" -->\r\n<pre><code>\r\n[X] Regression (a behavior that used to work and stopped working in a new release)\r\n[] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[] Feature request\r\n[] Documentation issue or request\r\n[] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n</code></pre>\r\n\r\n## Current behavior\r\n<!-- Describe how the issue manifests. -->\r\nAn error instance does not exist when the backend responds with an error with HttpClient.post (can be a general issue, I only experienced it with the post method so far)\r\n<pre><code>\r\nTypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.\r\n    at subscribeToResult (subscribeToResult.js:74)\r\n    at CatchSubscriber.error (catchError.js:112)\r\n    at XMLHttpRequest.onLoad (http.js:2283)\r\n    at ZoneDelegate.invokeTask (zone.js:421)\r\n    at Object.onInvokeTask (core.js:4740)\r\n    at ZoneDelegate.invokeTask (zone.js:420)\r\n    at Zone.runTask (zone.js:188)\r\n    at ZoneTask.invokeTask [as invoke] (zone.js:496)\r\n    at invokeTask (zone.js:1517)\r\n    at XMLHttpRequest.globalZoneAwareCallback (zone.js:1543)\r\n</code></pre>\r\n\r\n## Expected behavior\r\n<!-- Describe what the desired behavior would be. -->\r\nHttpClient.post should give the error instance instead of undefined\r\n\r\n## Minimal reproduction of the problem with instructions\r\n<!--\r\nFor bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).\r\n-->\r\n- Call a backend API with HttpClient.post and make sure the call will result in an error\r\n- Use either the catchError operator or catch the error in the observer\r\n- Try logging the error instance to the console\r\n- You will probably get a similar stracktrace from above\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n<!-- Describe the motivation or the concrete use case. -->\r\nWell, it's quite obvious no need to mention anything.\r\n## Environment\r\n\r\n<pre><code>\r\nAngular version: 5.2.7\r\n<!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\nBrowser:\r\n- [X] Chrome (desktop) version 64.0.3282.186 (Official build) (64-bits) (cohort: Stable)\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [ ] Firefox version XX\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX\r\n \r\nFor Tooling issues:\r\n- Node version: 8.9.1  <!-- run `node --version` -->\r\n- Platform: Windows <!-- Mac, Linux, Windows -->\r\n\r\nOthers:\r\nRxJS version 5.5.6\r\n<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->\r\n</code></pre>\r\n"}}
{"actor":{"display_login":"abdullahsari"}}