Skip to main content
1 of 2
Komi Golov
  • 3.2k
  • 19
  • 29

I'm not a fan of the TrySomething with out parameter pattern, so I would sooner do the following:

while (true) {
    try {
        possiblyFailingOperation();
        break;
    }
    catch (Exception e) {
        reportError();
        if (abortRequested())
            throw;
    }
}
Komi Golov
  • 3.2k
  • 19
  • 29