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); } } } }
public static bool IsPreconditionFailed(this Microsoft.Azure.Cosmos.Table.StorageException storageException) { return(storageException?.RequestInformation?.HttpStatusCode == (int)HttpStatusCode.PreconditionFailed); }
public static bool IsNotFound(this Microsoft.Azure.Cosmos.Table.StorageException storageException) { return(storageException?.RequestInformation?.HttpStatusCode == (int)HttpStatusCode.NotFound); }