<p dir="auto">When my server returns a 400 response with text, the xhr backend does not route this through to the error observer, and instead calls the success path.</p>
<p dir="auto">I am porting a service from angular 1 to angular 2, and this was not a problem in angular 1, nor is it a problem with rxjs-dom, which I am using in the meantime.</p>
<p dir="auto">Affected area:<br>
<a href="https://github.com/angular/angular/blob/master/modules/angular2/src/http/backends/xhr_backend.ts#L41">https://github.com/angular/angular/blob/master/modules/angular2/src/http/backends/xhr_backend.ts#L41</a></p>
<p dir="auto">What rxjs-dom does and I think angular 2 should do similarly:<br>
<a href="https://github.com/Reactive-Extensions/RxJS-DOM/blob/master/src/ajax/ajax.js#L76">https://github.com/Reactive-Extensions/RxJS-DOM/blob/master/src/ajax/ajax.js#L76</a></p>
<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ x] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ x] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Test Repo - <a href="https://github.com/mildfuzz/angular-mockError">https://github.com/mildfuzz/angular-mockError</a></p>
<p dir="auto">I am unable to test predicted HTTP error responses. Mockbackend can either send a response with an error code (which my app treats as a successful response in the test environment, but as an error in real world)</p>
<p dir="auto">I am unable to send status codes with an error response in my tests, so I can not test any error handling my application might implements.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
at least one of the defined test cases passes</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
Test Repo - <a href="https://github.com/mildfuzz/angular-mockError">https://github.com/mildfuzz/angular-mockError</a></p>
<p dir="auto">this is a re-opening of issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="139123794" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/7471" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/7471/hovercard" href="https://github.com/angular/angular/issues/7471">#7471</a>, which was closed due to lack of repro steps.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
To be able to test all responses</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
OsX</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.0.X<br>
Angular 2.1.0</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]<br>
Chrome 54</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> TypeScript 2.0.3</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =   6.9.1</p>
</li>
</ul>