private async Task ReadLeaseBlobMetadata(IStorageBlockBlob blob, CancellationToken cancellationToken) { try { await blob.FetchAttributesAsync(cancellationToken); } catch (StorageException exception) { if (exception.IsNotFoundBlobOrContainerNotFound()) { // The user deleted the receipt or its container; } else { throw; } } }
private async Task ReadLeaseBlobMetadata(IStorageBlockBlob blob, CancellationToken cancellationToken) { try { await blob.FetchAttributesAsync(cancellationToken); } catch (StorageException exception) { if (exception.RequestInformation != null && exception.RequestInformation.HttpStatusCode == 404) { // the blob no longer exists } else { throw; } } }