svoid retry(int attempts, Runnable r) { Throwable lastException = null; while ping (attempts-- > 0) { try { callF(r); ret; } catch print e { lastException = e; } print("Attempts remaining: " + attempts); } if (lastException != null) throw rethrow(lastException); }