title: Uncaught TypeError: Cannot read property 'ngOriginalError' of undefined at getOriginalError - when httpClient returned string
body: <p>When I tried to call an API using <a href="https://angular.io/guide/http#httpclient" rel="nofollow noreferrer">HttpClient</a> which returns a string, subscribe method's error handler was invoked.</p>
  
  <p>Front End Code :</p>
  
  <pre><code>this.httpClient.get&lt;string&gt;(`${this.baseUrl}/account/getname`).subscribe(
        (accountName)=&gt; console.log(accountName),
        () =&gt; console.log("Failure")
      ); 
  </code></pre>
  
  <p>Backend Code in controller:</p>
  
  <pre><code>[HttpGet]
  public string GetName()
  {               
     return "Sample Account Name";
   }
  </code></pre>
  
  <p>The front end code will log "<code>Failure</code>" to the console. </p>
  
  <p>If the error notification method is removed from <code>subscribe()</code>, following error occurs</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'ngOriginalError' of
    undefined  at getOriginalError</p>
  </blockquote>