title: Property 'error' does not exist on type '"" | Promise<any>'
body: <p>I'm trying to add some error handling to a service, following the Angular <a href="https://angular.io/docs/ts/latest/guide/server-communication.html#!#error-handling" rel="noreferrer">guide</a>. </p>
  
  <p>Relevant snippet:</p>
  
  <pre><code>private handleError (error: Response | any) {
    // In a real world app, you might use a remote logging infrastructure
    let errMsg: string;
    if (error instanceof Response) {
      const body = error.json() || '';
      const err = body.error || JSON.stringify(body);
      errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
    } else {
      errMsg = error.message ? error.message : error.toString();
    }
    console.error(errMsg);
    return Observable.throw(errMsg);
  }
  </code></pre>
  
  <p>However, I'm getting a TypeScript error:</p>
  
  <p><code>error TS2339: Property 'error' does not exist on type '"" | Promise&lt;any&gt;'.
    Property 'error' does not exist on type '""'.
  </code></p>
  
  <p>I can understand <em>why</em> it's happening-- <code>error.json()</code> returns a <code>Promise&lt;any&gt;</code> and then the subsequent line with <code>body.error</code> wouldn't work because there is no <code>error</code> property. However, it seems like it should expect a JSON object to be returned from <code>.json()</code>. Why is that, and what am I missing that the Angular guide isn't?</p>