I have the following code
try {
for (const customer of customers)
{
followUser(ig, customer.trim());
}
} catch (err){
console.log('ERROR: ' + " " + err);
}
followUser is an API call.. which sometimes out of the blue can return 400 or 404 errors when server has issues.. how do I break out of the for loop when one of the followUser generates an error?