public static void Main()
for (var i = 0; i < retryCount; i++)
Console.WriteLine("Test " + i);
throw new Exception("Ex = " + i);
if (i == (retryCount - 1))
Console.WriteLine("Exiting with error " + i);
throw new Exception("ERROR" + ex.Message);
Console.WriteLine("Retrying " + i);
Console.WriteLine("End");