Can axios call handle different response types?

I have an axios call as below

return axios.post(url, data, headObj)
.catch(err => {
return err.response;
});

Now there are 2 scenarios for the same endpoint;

  1. If it is success response, I get a blob output (excel file)
  2. If it is failure, I get an error JSON

How do I handle both the cases with the axios call ?