elcattivo / CloudFlareUtilities

A .NET Standard Library to bypass Cloudflare's Anti-DDoS measure (JavaScript challenge) using a DelegatingHandler.
MIT License
190 stars 47 forks source link

CloudFlareException is not catching exceptions after all attempts. #35

Open paulaolileal opened 6 years ago

paulaolileal commented 6 years ago
...
} 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.