Handling json error messages in blob http calls

Viewed 4529

We have http calls like:

this.http.get(`${environment.baseUrl}/api/v.1/reports/...`, 
{ responseType: ResponseContentType.Blob })

which returns blob pdfs which we further on save through FileSaver.

Problem is if server returns 4XX response with some application/json and message in body. In that case, we cannot find a way how to access it as responseType has to be set prior to request and cannot be altered later.

Is there any elegant solution for it?

1 Answers
Related