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;
- If it is success response, I get a blob output (excel file)
- If it is failure, I get an error JSON
How do I handle both the cases with the axios call ?