Evalutate AggregateException after flattening.
This commit is contained in:
Родитель
53bcf4af7d
Коммит
9c1f84beb7
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче