<PackageReference Include="Azure.Storage.Blobs" Version="12.25.1" />

BlobErrors

class BlobErrors : Errors
Create exceptions for common error cases.
using Azure.Storage.Blobs.Models; using System; namespace Azure.Storage.Blobs { internal class BlobErrors : Errors { public static ArgumentOutOfRangeException BlobConditionsMustBeDefault(params string[] conditions) { return new ArgumentOutOfRangeException("The " + string.Join(" and ", conditions) + " conditions must have their default values because they are ignored by the blob service"); } public static InvalidOperationException BlobOrContainerMissing(string leaseClient, string blobBaseClient, string blobContainerClient) { return new InvalidOperationException(leaseClient + " requires either a " + blobBaseClient + " or " + blobContainerClient); } public static ArgumentException InvalidDateTimeUtc(string dateTime) { return new ArgumentException(dateTime + " must be UTC"); } public static RequestFailedException InvalidRangeWithNonEmptyBlob(RequestFailedException ex) { return new RequestFailedException("Invalid range exception during ranged download despite non-empty blob", (Exception)ex); } internal static void VerifyHttpsCustomerProvidedKey(Uri uri, CustomerProvidedKey? customerProvidedKey) { if (customerProvidedKey.HasValue && !string.Equals(uri.Scheme, "https", StringComparison.OrdinalIgnoreCase)) throw new ArgumentException("Cannot use client-provided key without HTTPS."); } internal static void VerifyCpkAndEncryptionScopeNotBothSet(CustomerProvidedKey? customerProvidedKey, string encryptionScope) { if (customerProvidedKey.HasValue && encryptionScope != null) throw new ArgumentException("CustomerProvidedKey and EncryptionScope cannot both be set"); } public static ArgumentException ParsingFullHttpRangeFailed(string range) { return new ArgumentException("Could not obtain the total length from HTTP range " + range); } } }