Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
storage/azure: eat abort err
Browse files Browse the repository at this point in the history
Signed-off-by: huanghaoyuan <[email protected]>
  • Loading branch information
huanghaoyuanhhy committed Dec 21, 2023
1 parent ac770eb commit 33230d2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions storage/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ func (a *AzureClient) CopyObject(ctx context.Context, i CopyObjectInput) error {
if err != nil {
return fmt.Errorf("storage: azure get properties %w", err)
}
var copyErr error
if blobProperties.CopyID != nil {
_, err := blobCli.AbortCopyFromURL(ctx, *blobProperties.CopyID, nil)
if err != nil {
return fmt.Errorf("storage: azure abort copy from url %w", err)
}
_, copyErr = blobCli.AbortCopyFromURL(ctx, *blobProperties.CopyID, nil)
}

if _, err := blobCli.CopyFromURL(ctx, url, nil); err != nil {
return fmt.Errorf("storage: azure copy from url %w", err)
return fmt.Errorf("storage: azure copy from url %w abort %w", err, copyErr)
}

return nil
Expand Down

0 comments on commit 33230d2

Please sign in to comment.