I ran into an issue with $http called with responseType: blob. I would like to handle errors response in JSON but I get blob data instead even if I set the response's content-type as 'application/json' on the server.
$http.post(url, data, {responseType: 'blob'})
.then(function(response) {
// download the file (works fine)
})
.catch(function(error) {
// handle JSON response error
});
Is there any way to do that without trying to convert error data to object?