Repository: angular
Issue: HttpErrorResponse statusText always default to 'OK' regardless of statusCode
Labels: type: bug/fix,breaking changes,freq1: low,area: common/http,state: confirmed,design complexity: low-hanging,P3

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
When server response does not contain any statusText, [HttpErrorResponse.statusText](https://angular.io/api/common/http/HttpResponseBase#statusText) is [automatically set to `OK`](https://github.com/angular/angular/blob/5.2.9/packages/common/http/src/xhr.ts#L140) regardless of the status code.
Thus you can end up with `403 OK` error response for instance, which I believe is weird. In the [previous documentation](https://angular.io/api/http/Response#statusText) it was clearly stated that `OK` was the default value, but I'm not sure to understand the reason behind it -- an empty string would be less confusing I think.

## Expected behavior
<!-- Describe what the desired behavior would be. -->
Either the statusString should be left empty, or even better check for status code and either use the proper http status for it, or show `ok` only for success status code only (and.. something has to be done for others)?

## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).
-->

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->
While debugging some 403 errors on a website, I looked at HttpErrorResponse object with a 403 OK status which made me think there was something going wrong with the server and/or the error handling, but actually that was not the error at all. I know that documentation states `Do not depend on this.`, but this is still misleading when you see that in logs IMO.

## Environment

<pre><code>
Angular version: 5.2.9, still applicable on latest version
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version 59.0.2
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  <!-- run `node --version` -->
- Platform:  <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>