Exemplo n.º 1
0
 public static void LogStorageExceptions(AggregateException aggregate,
                                         Action <Microsoft.Azure.Cosmos.Table.StorageException> tableStorageLogger = null,
                                         Action <RequestFailedException> blobStorageLogger = null)
 {
     if (aggregate.InnerExceptions != null)
     {
         foreach (Exception ex in aggregate.InnerExceptions)
         {
             Microsoft.Azure.Cosmos.Table.StorageException tableStorageException = ex as Microsoft.Azure.Cosmos.Table.StorageException;
             if (tableStorageException != null)
             {
                 tableStorageLogger?.Invoke(tableStorageException);
             }
             RequestFailedException blobException = ex as RequestFailedException;
             if (blobException != null)
             {
                 blobStorageLogger?.Invoke(blobException);
             }
         }
     }
 }
Exemplo n.º 2
0
 public static bool IsPreconditionFailed(this Microsoft.Azure.Cosmos.Table.StorageException storageException)
 {
     return(storageException?.RequestInformation?.HttpStatusCode == (int)HttpStatusCode.PreconditionFailed);
 }
Exemplo n.º 3
0
 public static bool IsNotFound(this Microsoft.Azure.Cosmos.Table.StorageException storageException)
 {
     return(storageException?.RequestInformation?.HttpStatusCode == (int)HttpStatusCode.NotFound);
 }