Sometimes my code breaks and it is out of my control
How would I do the following?
try { //do my stuff } catch { //sleep and try again }
Here is an easy algorithm:
do{ try { $tryAgain = false; /* Do everything that throws error here */ } catch(Exception $e) { $tryAgain = true; /* Do error reporting/archiving/logs here */ } } while($tryAgain);