/** * Pass any caught exceptions here * * @param exception the exception * @throws Exception if not retry-able or the retry policy returned negative */ public void TakeException(Exception exception) { bool rethrow = true; if (IsRetryException(exception)) { if (retryPolicy.AllowRetry(retryCount++, TimeSpan.FromTicks(System.DateTime.Now.Ticks - startTimeTicks), sleeper.SleepFor)) { tracer.AddCount("retries-allowed", 1); rethrow = false; } else { tracer.AddCount("retries-disallowed", 1); } } if (rethrow) { throw exception; } }