How can I read http errors when responseType is blob in Axios with VueJs? [duplicate]

The reason is that the response type is blob.
In case of error, the status code is available directly in your exception object. However, the response is a promise.

What you need to do is:

.catch((error) => {
    let statusCode = error.response.status
    let responseObj = await error.response.data.text();
       :
       :

For more details you can read documentation.

Leave a Comment