Evalutate AggregateException after flattening.

This commit is contained in:
Serkant Karaca 2018-06-27 17:24:08 -07:00
Родитель 53bcf4af7d
Коммит 9c1f84beb7
1 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -66,15 +66,30 @@ namespace Microsoft.Azure.EventHubs
{
return ((EventHubsException)exception).IsTransient;
}
else if (exception is TaskCanceledException)
{
if (exception.InnerException == null)
{
return true;
}
return IsRetryableException(exception.InnerException);
}
// Flatten AggregateException
else if (exception is AggregateException)
{
return IsRetryableException((exception as AggregateException).Flatten().InnerException);
}
// Other retryable exceptions here.
else if (exception is OperationCanceledException ||
exception is SocketException ||
exception is TaskCanceledException)
exception is SocketException)
{
return true;
}
return false;
}