title: Angular 5 manage http get with blob response and json errors
body: <p>I'm working on an Angular 5 application. I have to download a file from my backend-application and to do this I simply invoke a function like this:</p>
  
  <pre><code>public executeDownload(id: string): Observable&lt;Blob&gt; {
    return this.http.get(this.replaceUrl('app/download', denunciaId), {responseType: 'blob'}).map(result =&gt; {
      return result;
    });
  }
  </code></pre>
  
  <p>And to invoke the download service I just invoke:</p>
  
  <pre><code>public onDownload() {
    this.downloadService.executeDownload(this.id).subscribe(res =&gt; {
      saveAs(res, 'file.pdf');
    }, (error) =&gt; {
      console.log('TODO', error);
      // error.error is a Blob but i need to manage it as RemoteError[]
    });
  }
  </code></pre>
  
  <p>When the backend application is in a particular state, instead of returning a Blob, it returns an <code>HttpErrorResponse</code> that contains in its <code>error</code> field an array of RemoteError. RemoteError is an interface that I wrote to manage remote errors.</p>
  
  <p>In catch function, error.error is a Blob. How can I translate Blob attribute into an array of <code>RemoteError[]</code>?</p>
  
  <p>Thanks in advance. </p>