protected virtual void RetryPolicyTrace(object sender, RetryingEventArgs args)
 {
     var msg = string.Format(
          "{0} Retry - Count:{1}, Delay:{2}, Exception:{3}",
          this.GetType().Name,
          args.CurrentRetryCount,
          args.Delay,
          args.LastException.TraceInformation());
     TraceHelper.TraceWarning(msg);
 }
        public TransientRetry(RetryingEventArgs eventArgs)
        {
            var lastException = eventArgs.LastException;

            Delay = eventArgs.Delay.ToString();
            RetryCount = eventArgs.CurrentRetryCount;
            Exception = lastException.ToString();
            ExceptionMessage = lastException.Message;

            Url = HttpContext.Current.Request.Url.ToString();
            Server = Environment.MachineName;

            var sqlException = lastException as SqlException;
            if (sqlException != null)
                SqlErrorNumbers = String.Join(",", sqlException.Errors.Cast<SqlError>().Select(e => e.Number));

            PartitionKey = String.Format("0{0}", DateTime.UtcNow.Ticks);
            RowKey = String.Format("{0}|{1}", SqlErrorNumbers, RetryCount);
        }
Example #3
0
        private static void OnRetryPolicyRetrying(object sender, RetryingEventArgs e)
        {
            System.Diagnostics.Trace.WriteLine(string.Format("Retrying Sample: Count:{0} Delay:{1} LastError:{2}", e.CurrentRetryCount, e.Delay, e.LastException));

        }