tessl install tessl/golang-github-com--azure--azure-sdk-for-go--sdk--storage--azblob@1.6.0Azure Blob Storage SDK for Go providing comprehensive blob storage operations including uploads, downloads, container management, and advanced features like leases and SAS generation
The bloberror package provides error detection utilities and a comprehensive set of error codes for Azure Blob Storage operations.
import "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/bloberror"func HasCode(err error, codes ...Code) boolChecks if an error is an Azure Storage error with one of the specified error codes.
Example:
import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/bloberror"
)
_, err := blobClient.Download(ctx, nil)
if bloberror.HasCode(err, bloberror.BlobNotFound) {
fmt.Println("Blob does not exist")
} else if bloberror.HasCode(err, bloberror.AuthenticationFailed, bloberror.AuthorizationFailure) {
fmt.Println("Authentication or authorization failed")
} else if err != nil {
fmt.Printf("Other error: %v\n", err)
}var MissingSharedKeyCredential error
var UnsupportedChecksum errorMissingSharedKeyCredential: Returned when SAS URL generation requires SharedKeyCredential but none is availableUnsupportedChecksum: Returned for multi-part uploads when user-generated checksums cannot be validatedtype Code stringconst (
AccountAlreadyExists Code = "AccountAlreadyExists"
AccountBeingCreated Code = "AccountBeingCreated"
AccountIsDisabled Code = "AccountIsDisabled"
)const (
AuthenticationFailed Code = "AuthenticationFailed"
AuthorizationFailure Code = "AuthorizationFailure"
AuthorizationPermissionMismatch Code = "AuthorizationPermissionMismatch"
AuthorizationProtocolMismatch Code = "AuthorizationProtocolMismatch"
AuthorizationResourceTypeMismatch Code = "AuthorizationResourceTypeMismatch"
AuthorizationServiceMismatch Code = "AuthorizationServiceMismatch"
AuthorizationSourceIPMismatch Code = "AuthorizationSourceIPMismatch"
InsufficientAccountPermissions Code = "InsufficientAccountPermissions"
InvalidAuthenticationInfo Code = "InvalidAuthenticationInfo"
NoAuthenticationInformation Code = "NoAuthenticationInformation"
)const (
BlobAlreadyExists Code = "BlobAlreadyExists"
BlobArchived Code = "BlobArchived"
BlobBeingRehydrated Code = "BlobBeingRehydrated"
BlobImmutableDueToPolicy Code = "BlobImmutableDueToPolicy"
BlobNotArchived Code = "BlobNotArchived"
BlobNotFound Code = "BlobNotFound"
BlobOverwritten Code = "BlobOverwritten"
BlobTierInadequateForContentLength Code = "BlobTierInadequateForContentLength"
BlobUsesCustomerSpecifiedEncryption Code = "BlobUsesCustomerSpecifiedEncryption"
InvalidBlobOrBlock Code = "InvalidBlobOrBlock"
InvalidBlobTier Code = "InvalidBlobTier"
InvalidBlobType Code = "InvalidBlobType"
InvalidSourceBlobType Code = "InvalidSourceBlobType"
InvalidSourceBlobURL Code = "InvalidSourceBlobUrl"
InvalidVersionForPageBlobOperation Code = "InvalidVersionForPageBlobOperation"
)const (
BlockCountExceedsLimit Code = "BlockCountExceedsLimit"
BlockListTooLong Code = "BlockListTooLong"
InvalidBlockID Code = "InvalidBlockId"
InvalidBlockList Code = "InvalidBlockList"
)const (
ContainerAlreadyExists Code = "ContainerAlreadyExists"
ContainerBeingDeleted Code = "ContainerBeingDeleted"
ContainerDisabled Code = "ContainerDisabled"
ContainerNotFound Code = "ContainerNotFound"
)const (
CannotVerifyCopySource Code = "CannotVerifyCopySource"
CopyAcrossAccountsNotSupported Code = "CopyAcrossAccountsNotSupported"
CopyIDMismatch Code = "CopyIdMismatch"
NoPendingCopyOperation Code = "NoPendingCopyOperation"
PendingCopyOperation Code = "PendingCopyOperation"
)const (
IncrementalCopyBlobMismatch Code = "IncrementalCopyBlobMismatch"
IncrementalCopyOfEralierVersionSnapshotNotAllowed Code = "IncrementalCopyOfEralierVersionSnapshotNotAllowed"
IncrementalCopySourceMustBeSnapshot Code = "IncrementalCopySourceMustBeSnapshot"
)const (
InfiniteLeaseDurationRequired Code = "InfiniteLeaseDurationRequired"
LeaseAlreadyBroken Code = "LeaseAlreadyBroken"
LeaseAlreadyPresent Code = "LeaseAlreadyPresent"
LeaseIDMismatchWithBlobOperation Code = "LeaseIdMismatchWithBlobOperation"
LeaseIDMismatchWithContainerOperation Code = "LeaseIdMismatchWithContainerOperation"
LeaseIDMismatchWithLeaseOperation Code = "LeaseIdMismatchWithLeaseOperation"
LeaseIDMissing Code = "LeaseIdMissing"
LeaseIsBreakingAndCannotBeAcquired Code = "LeaseIsBreakingAndCannotBeAcquired"
LeaseIsBreakingAndCannotBeChanged Code = "LeaseIsBreakingAndCannotBeChanged"
LeaseIsBrokenAndCannotBeRenewed Code = "LeaseIsBrokenAndCannotBeRenewed"
LeaseLost Code = "LeaseLost"
LeaseNotPresentWithBlobOperation Code = "LeaseNotPresentWithBlobOperation"
LeaseNotPresentWithContainerOperation Code = "LeaseNotPresentWithContainerOperation"
LeaseNotPresentWithLeaseOperation Code = "LeaseNotPresentWithLeaseOperation"
)const (
AppendPositionConditionNotMet Code = "AppendPositionConditionNotMet"
ConditionHeadersNotSupported Code = "ConditionHeadersNotSupported"
ConditionNotMet Code = "ConditionNotMet"
MaxBlobSizeConditionNotMet Code = "MaxBlobSizeConditionNotMet"
MultipleConditionHeadersNotSupported Code = "MultipleConditionHeadersNotSupported"
SequenceNumberConditionNotMet Code = "SequenceNumberConditionNotMet"
SourceConditionNotMet Code = "SourceConditionNotMet"
TargetConditionNotMet Code = "TargetConditionNotMet"
)const (
ContentLengthLargerThanTierLimit Code = "ContentLengthLargerThanTierLimit"
EmptyMetadataKey Code = "EmptyMetadataKey"
FeatureVersionMismatch Code = "FeatureVersionMismatch"
InvalidHTTPVerb Code = "InvalidHttpVerb"
InvalidHeaderValue Code = "InvalidHeaderValue"
InvalidInput Code = "InvalidInput"
InvalidMD5 Code = "InvalidMd5"
InvalidMetadata Code = "InvalidMetadata"
InvalidOperation Code = "InvalidOperation"
InvalidPageRange Code = "InvalidPageRange"
InvalidQueryParameterValue Code = "InvalidQueryParameterValue"
InvalidRange Code = "InvalidRange"
InvalidResourceName Code = "InvalidResourceName"
InvalidURI Code = "InvalidUri"
InvalidXMLDocument Code = "InvalidXmlDocument"
InvalidXMLNodeValue Code = "InvalidXmlNodeValue"
MD5Mismatch Code = "Md5Mismatch"
CRC64Mismatch Code = "Crc64Mismatch"
MetadataTooLarge Code = "MetadataTooLarge"
MissingContentLengthHeader Code = "MissingContentLengthHeader"
MissingRequiredHeader Code = "MissingRequiredHeader"
MissingRequiredQueryParameter Code = "MissingRequiredQueryParameter"
MissingRequiredXMLNode Code = "MissingRequiredXmlNode"
OutOfRangeInput Code = "OutOfRangeInput"
OutOfRangeQueryParameterValue Code = "OutOfRangeQueryParameterValue"
RequestBodyTooLarge Code = "RequestBodyTooLarge"
RequestURLFailedToParse Code = "RequestUrlFailedToParse"
ResourceAlreadyExists Code = "ResourceAlreadyExists"
ResourceNotFound Code = "ResourceNotFound"
ResourceTypeMismatch Code = "ResourceTypeMismatch"
SequenceNumberIncrementTooLarge Code = "SequenceNumberIncrementTooLarge"
UnsupportedHTTPVerb Code = "UnsupportedHttpVerb"
UnsupportedHeader Code = "UnsupportedHeader"
UnsupportedQueryParameter Code = "UnsupportedQueryParameter"
UnsupportedXMLNode Code = "UnsupportedXmlNode"
)const (
PreviousSnapshotCannotBeNewer Code = "PreviousSnapshotCannotBeNewer"
PreviousSnapshotNotFound Code = "PreviousSnapshotNotFound"
PreviousSnapshotOperationNotSupported Code = "PreviousSnapshotOperationNotSupported"
SnapshotCountExceeded Code = "SnapshotCountExceeded"
SnapshotOperationRateExceeded Code = "SnapshotOperationRateExceeded"
SnapshotsPresent Code = "SnapshotsPresent"
)const (
ImmutabilityPolicyDeleteOnLockedPolicy Code = "ImmutabilityPolicyDeleteOnLockedPolicy"
)const (
CannotChangeToLowerTier Code = "CannotChangeToLowerTier"
)const (
OperationNotAllowedOnIncrementalCopyBlob Code = "OperationNotAllowedOnIncrementalCopyBlob"
OperationNotAllowedOnRootBlob Code = "OperationNotAllowedOnRootBlob"
OperationTimedOut Code = "OperationTimedOut"
UnauthorizedBlobOverwrite Code = "UnauthorizedBlobOverwrite"
)const (
InternalError Code = "InternalError"
ServerBusy Code = "ServerBusy"
SystemInUse Code = "SystemInUse"
)