I am attempting to add retries to a function but I'm unsure if the following is a safe way to do this
void start()
{
int count = 0;
while (true)
{
if (!configure())
{
count++;
if (count == 2)
{
//error handling
return;
}
}
count = 0;
break;
}
//do other stuff
}
Will this work?