title: How to stop errors generated by zone.js in browser console?
body: <p>Here is my code in the httpService.ts</p>
  
  <pre><code>public HttpPost(url: string, data: any): Observable&lt;Response&gt; 
  {
      let headers = new Headers();
      let reqOpts = new RequestOptions();
      headers.append(AUTH_CONTENT_TYPE_KEY, AUTH_CONTENT_TYPE);
      if (this.Token) {
          headers.append(AUTH_HEADER_KEY, AUTH_TOKEN_PREFIX + this.Token);
      }
      reqOpts.headers = headers;
      return this.http.post(url, data, reqOpts).timeout(30000).map((res: Response) =&gt; res)
          .catch((err: Response) =&gt; { return Observable.throw(err) });
  }
  </code></pre>
  
  <p>If I try to using this service to call an API like this way:</p>
  
  <pre><code>this.httpService.HttpPost(url, data).subscribe(
      (res: any) =&gt; 
      {
         // do something
      },
      (error: any) =&gt; 
      {
          if (error.status === 409)
              // do something
          else if (error.status === 401)
              // do something
          else
             // do something
      }
  );
  </code></pre>
  
  <p>and if the res status code is one other than 200, such as 401, 403 or 409, then these kind of annoying errors are generated by zone.js in console. (sorry for hide part url of APIs)</p>
  
  <p><a href="https://i.stack.imgur.com/ngcuK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ngcuK.png" alt="enter image description here"></a></p>
  
  <p>So is there anyway to stop zone.js to generate such a kind of annoying errors in console, tried to google for a solution with example but not found yet, Thanks!</p>
  
  <p>tried to use this in main.ts but not worked:</p>
  
  <pre><code>window.console.error = function() {};
  </code></pre>
  
  <p>Edit: add stack trace:</p>
  
  <p><a href="https://i.stack.imgur.com/G9QAc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/G9QAc.png" alt="enter image description here"></a></p>