Closed orchardc closed 3 years ago
Hello @orchardc, the method will throw a HttpRequestException
exception with a message containing the unsuccessful status code. You could do something like the following:
try
{
result = await client.SearchCompanyAsync(request);
}
catch (HttpRequestException ex) when (ex.Message.StartsWith("Response status code does not indicate success: 429"))
{
// wait for a bit and then maybe retry.
}
Got it, thanks Kevin!
@kevbite First of all, thanks so much for sharing this api, which is very useful and time-saving!
As CompaniesHouse set per application rates:
What is the best way to handel the 429 error when using this code? As the code shown doesn't have the response status (i.e. 429).