I am trying to send multiple requests to a customized HTTP server which sends response only for a few requests. The js which I wrote use Axios to send multiple requests and stop sending the requests as soon as one response is received. My script is as follows:
async function poll() {
let countOfError = 0;
const maxErrors = 10;
let resp = null;
while (true) {
try {
resp = await axios.get('http://localhost:8080/ubuntu_default.html', { withCredentials: true });
//check if resp is "success" then break;
if (resp.data.success) break;
} catch (e) {
//console.error(e); optional
countOfErrors += 1;
if (countOfErrors > maxErrors) break;
}
}
return resp.data;
}
However, I am receiving the following error in the console:
"DevTools failed to load SourceMap: Could not load content for http://localhost:8080/axios.min.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE"