Failed to process file download, how to convert Blob object to Json?

[ description ]:
axios sets the error that responseType:blob, expects to report to the backend when downloading fails.
but at this time, the error message returned by the backend has been converted to blob object. How to transfer the blob object back to the original Json?

or how to handle interception, because the axios interceptor cannot tell whether to enter then or catch when blob object.
when the backend returns an error status code other than 200, it does not return Json object parsing

[ related codes ]

  https://codeshelper.com/q/10.


use FileReader

var reader = new FileReader()
reader.onload = e => console.log(JSON.parse(e.target.result))
reader.readAsText(blob)

//blobtypejsonstreamstreamnamejsonnamefileReaderblob

var reader = new FileReader();
reader.addEventListener("loadend", function() {
    console.log(JSON.parse(reader.result));
});
reader.readAsText(blob,['utf-8']);

  

the first and second floors are correct, but I must add that if (res.data.type = 'application/json') {. }, before it can be executed. I would like to remind you all here

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b1f9-2c285.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b1f9-2c285.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?