or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
golangpkg:golang/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob@v1.6.4

docs

appendblob.mdblob.mdblockblob.mdclient.mdcontainer.mderrors.mdindex.mdlease.mdpageblob.mdsas.mdservice.md
tile.json

tessl/golang-github-com--azure--azure-sdk-for-go--sdk--storage--azblob

tessl install tessl/golang-github-com--azure--azure-sdk-for-go--sdk--storage--azblob@1.6.0

Azure Blob Storage SDK for Go providing comprehensive blob storage operations including uploads, downloads, container management, and advanced features like leases and SAS generation

errors.mddocs/

Error Handling (bloberror package)

The bloberror package provides error detection utilities and a comprehensive set of error codes for Azure Blob Storage operations.

Package Import

import "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/bloberror"

Error Detection

HasCode

func HasCode(err error, codes ...Code) bool

Checks 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)
}

Error Variables

var MissingSharedKeyCredential error
var UnsupportedChecksum error
  • MissingSharedKeyCredential: Returned when SAS URL generation requires SharedKeyCredential but none is available
  • UnsupportedChecksum: Returned for multi-part uploads when user-generated checksums cannot be validated

Error Code Type

type Code string

Error Codes

Account Errors

const (
    AccountAlreadyExists Code = "AccountAlreadyExists"
    AccountBeingCreated  Code = "AccountBeingCreated"
    AccountIsDisabled    Code = "AccountIsDisabled"
)

Authentication and Authorization Errors

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"
)

Blob Errors

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"
)

Block Blob Errors

const (
    BlockCountExceedsLimit Code = "BlockCountExceedsLimit"
    BlockListTooLong       Code = "BlockListTooLong"
    InvalidBlockID         Code = "InvalidBlockId"
    InvalidBlockList       Code = "InvalidBlockList"
)

Container Errors

const (
    ContainerAlreadyExists Code = "ContainerAlreadyExists"
    ContainerBeingDeleted  Code = "ContainerBeingDeleted"
    ContainerDisabled      Code = "ContainerDisabled"
    ContainerNotFound      Code = "ContainerNotFound"
)

Copy Errors

const (
    CannotVerifyCopySource         Code = "CannotVerifyCopySource"
    CopyAcrossAccountsNotSupported Code = "CopyAcrossAccountsNotSupported"
    CopyIDMismatch                 Code = "CopyIdMismatch"
    NoPendingCopyOperation         Code = "NoPendingCopyOperation"
    PendingCopyOperation           Code = "PendingCopyOperation"
)

Incremental Copy Errors

const (
    IncrementalCopyBlobMismatch                       Code = "IncrementalCopyBlobMismatch"
    IncrementalCopyOfEralierVersionSnapshotNotAllowed Code = "IncrementalCopyOfEralierVersionSnapshotNotAllowed"
    IncrementalCopySourceMustBeSnapshot               Code = "IncrementalCopySourceMustBeSnapshot"
)

Lease Errors

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"
)

Condition Errors

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"
)

Request/Response Errors

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"
)

Snapshot Errors

const (
    PreviousSnapshotCannotBeNewer         Code = "PreviousSnapshotCannotBeNewer"
    PreviousSnapshotNotFound              Code = "PreviousSnapshotNotFound"
    PreviousSnapshotOperationNotSupported Code = "PreviousSnapshotOperationNotSupported"
    SnapshotCountExceeded                 Code = "SnapshotCountExceeded"
    SnapshotOperationRateExceeded         Code = "SnapshotOperationRateExceeded"
    SnapshotsPresent                      Code = "SnapshotsPresent"
)

Immutability and Legal Hold Errors

const (
    ImmutabilityPolicyDeleteOnLockedPolicy Code = "ImmutabilityPolicyDeleteOnLockedPolicy"
)

Tier Errors

const (
    CannotChangeToLowerTier Code = "CannotChangeToLowerTier"
)

Operation Errors

const (
    OperationNotAllowedOnIncrementalCopyBlob Code = "OperationNotAllowedOnIncrementalCopyBlob"
    OperationNotAllowedOnRootBlob            Code = "OperationNotAllowedOnRootBlob"
    OperationTimedOut                        Code = "OperationTimedOut"
    UnauthorizedBlobOverwrite                Code = "UnauthorizedBlobOverwrite"
)

Server Errors

const (
    InternalError Code = "InternalError"
    ServerBusy    Code = "ServerBusy"
    SystemInUse   Code = "SystemInUse"
)