title: ASP.NET Core WebApi return error message to AngularJS $http promise
body: <p>I would like to return exception message to the AngularJS UI.
  As a back-end I use ASP.NET Core Web Api controller:</p>
  
  <pre><code>    [Route("api/cars/{carNumber}")]
      public string Get(string carNumber)
      {
          var jsonHttpResponse = _carInfoProvider.GetAllCarsByNumber(carNumber);
          if (jsonHttpResponse.HasError)
          {
              var message = new HttpResponseMessage(HttpStatusCode.InternalServerError)
              {
                  Content = new StringContent(jsonHttpResponse.ErrorMessage)
              };
  
              throw new HttpResponseException(message);
          }
  
          return jsonHttpResponse.Content;
      }
  </code></pre>
  
  <p>But on Angular side, failure promise sees only status and statusText "Internal server error":</p>
  
  <p><a href="https://i.stack.imgur.com/fntoS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fntoS.png" alt="enter image description here"></a></p>
  
  <p>How can I pass the error message to the Angular $http failure promise from Core Web Api? </p>