No problem, here comes the "While Pattern".
Problem to solve :
A program crashes randomly but sometimes work
Solution :
boolean success;
do {
try {
buggyProgram();
success = true;
} catch (... well anything) {
}
} while (!success);
Bonus point : the low voltage version with a 1sec sleep after the buggy program call.
Stay tuned for the double while pattern ;-)
No comments:
Post a Comment