fetch(link, {
redirect: "follow",
signal: AbortSignal.timeout(1000)
})
.then((resp) => {
console.log(resp.status + " " + link);
statuses.push({url: link, status: resp.status});
})
.catch((error) => {
if (error.status === undefined) error.status = "error";
console.log("Fetch failed for: ", link + " Status Code: " + error.status)
statuses.push({url: link, status: error.status});
})
Given this js code, how can I see in the catch part if it was executed because of abort signal controller timeout?
I would like to have an if in it and do something special when the timeout was hit ...