...
} catch (AggregateException ex) when (ex.InnerException is CloudFlareClearanceException) {
// After all retries, clearance still failed.
Console.WriteLine( ex.Message );
} catch (AggregateException ex) when (ex.InnerException is TaskCanceledException) {
// Looks like we ran into a timeout. Too many clearance attempts?
Console.WriteLine( ex.Message );
// Maybe you should increase client.Timeout as each attempt will take about five seconds.
} catch (Exception ex) {
Console.WriteLine( ex.Message );
}
...
The code of the example was used, and it continues giving error and was necessary to add a generic exception to capture the same.
The code of the example was used, and it continues giving error and was necessary to add a generic exception to capture the same.