Angular2 extract json from error
<p>I'm wrinting a pice of Angular2 code that interacts with a server which returns a json with http error codes such as 404 or 401.
I can't find a way to read the json out of the error response.
I can't use .map() since there is no data on normal response.</p>

<pre><code>return new Promise((resolve, reject: Response) =&gt; {
      this.http.request(new Request(requestoptions))
          .subscribe(
          data =&gt; {resolve()},
          error =&gt; { error.json() } //&lt;-- No json()
          )
       };
</code></pre>

<p>How handle this?</p>