Is there a way allow execution of a bad block of code after an exception of thrown?
Presently, my code has an while loop that runs continuously. The code inside this while loop sometimes throws a vector out of range error. I have been unable to track down the cause of this particular exception, but ultimately, it doesn't matter much because the code inside the while loop does the same thing over and over again and the next iteration does not depend on the previous iteration in any way.
This, after the code within the while loop crashes, I would like it to start again from the top of the while statement.
Is there a way to accomplish this in C++? try/catch doesn't seem to work in this situation.
Additional Info: I would love to just take the code within the while loop, make it into its own executable, and put the while loop into a bash script, but there's some data each iteration requires that remains static and it takes too much time to re-load that data each time so I am forced to do my infinite while loop within C++
catchthe exception in the scope of the loop and continue from there. But, really you NEED to find the root cause of your problem.On Error Resume Nextfor C++. I cannot recommend it.