private async Task<CheckResult> TestHTTP()
{
...
// above code creates httpclient as client
try
{
(!) response = await client.GetAsync(expectedURL);
}
catch (TaskCanceledException ex) when (ex.InnerException is TimeoutException)
{
client.Dispose();
handler.Dispose();
return CheckResult.TimedOut;
}
catch
{
client.Dispose();
handler.Dispose();
return CheckResult.TimedOut;
}
...
}
private async Task<CheckResult> TestHTTP()
{
...
// above code creates httpclient as client
try
{
(!) response = await client.GetAsync(expectedURL);
}
catch (TaskCanceledException ex) when (ex.InnerException is TimeoutException)
{
client.Dispose();
handler.Dispose();
return CheckResult.TimedOut;
}
catch
{
client.Dispose();
handler.Dispose();
return CheckResult.TimedOut;
}
...
}