I have a list of sites and I want each one of them with Axios, but it seems that the order of the requests is respected, besides that not all of them fall into the catch.
What is the best way to perform a sequence of requests?
Code:
async function searchContent(url) {
try {
let request = await axios(url);
let content = await request.data;
return content;
} catch (e) {
return e;
}
}
async function start() {
sites.forEach(async (item)=>{
let content = await searchContent(`https://${item["URL"]}`);
//DEBUG
console.log(content)
})
}
Error (Error is long, so 3 prints):
https://i.stack.imgur.com/7PXMh.png