Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
storage/azure: eat abort err (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: huanghaoyuan <[email protected]>
  • Loading branch information
huanghaoyuanhhy authored Jan 4, 2024
1 parent ac770eb commit c3a0ab1
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 c3a0ab1

Please sign in to comment.