我有以下代码(Xamarin.iOS)
try
{
httpResult = await _httpClient.GetAsync( uri, cts.Token ).ConfigureAwait( false );
...
}
catch ( System.Net.WebException ex )
{
Console.WriteLine( "!Web exception outer uri :" + URI + " message: " + ex.Message);
}
catch ( Exception ex )
{
var isWebException = ex is System.Net.WebException; // ----> TRUE ???
}
有时WebException不会被WebException块捕获,但通常是异常块(isWebException = true)。 这怎么可能是真的?