In my Project i am working with different servers (actually vehicles) with different ip adresses. Each vehicle has a list of all vehicles and their ip adresses. I am trying to initialize the vehicles on a map in a for loop. In this for loop i am sending a Post Request to "http:ipOfVehicle:port:/get_position"
const response = await fetch(url, {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
Everything is working fine, but if the first vehicle is offline it wont initialize even one vehicle. And after a while i get the Failed to load resource error (in Safari) or the net::ERR_CONNECTION_TIMED_OUT error (in Chrome)
I tried different Methods like try-catch, aborting with the AbortController() and also first checking if the server is reachable with npm is-reachable, but nothing is working.
I would be really glad if someone could help me out :)