azure: storageErr is already azblob.StorageError type
This commit is contained in:
parent
7bae91eb9a
commit
561bbbbdf3
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ func (c StorageClient) CreateStorageContainerIfNotExist(ctx context.Context, sto
|
|||
|
||||
_, err := containerURL.Create(ctx, azblob.Metadata{}, azblob.PublicAccessNone)
|
||||
if err != nil {
|
||||
if storageErr, ok := err.(azblob.StorageError); ok && storageErr.(azblob.StorageError).ServiceCode() == azblob.ServiceCodeContainerAlreadyExists {
|
||||
if storageErr, ok := err.(azblob.StorageError); ok && storageErr.ServiceCode() == azblob.ServiceCodeContainerAlreadyExists {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("cannot create a storage container: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue