Skip to content

Commit

Permalink
fix: pass correct error obj for azure blob failures (#9276)
Browse files Browse the repository at this point in the history
In certain cases, if there is a failure reading from azure blob storage,
an empty error was used in the return error format string rather than
the correct original error.

Signed-off-by: Brian Loss <[email protected]>
  • Loading branch information
brianloss committed Aug 3, 2022
1 parent e2c2ad3 commit 083f3a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workflow/artifacts/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (azblobDriver *ArtifactDriver) Load(artifact *wfv1.Artifact, path string) e
}
isEmptyFile = true
} else if !IsAzureError(origErr, azblob.StorageErrorCodeBlobNotFound) {
return fmt.Errorf("unable to download blob %s: %s", artifact.Azure.Blob, err)
return fmt.Errorf("unable to download blob %s: %s", artifact.Azure.Blob, origErr)
}

isDir, err := azblobDriver.IsDirectory(artifact)
Expand Down Expand Up @@ -227,7 +227,7 @@ func (azblobDriver *ArtifactDriver) OpenStream(artifact *wfv1.Artifact) (io.Read
return response.Body(nil), nil
}
} else if !IsAzureError(origErr, azblob.StorageErrorCodeBlobNotFound) {
return nil, fmt.Errorf("unable to open stream for blob %s: %s", artifact.Azure.Blob, err)
return nil, fmt.Errorf("unable to open stream for blob %s: %s", artifact.Azure.Blob, origErr)
}

isDir, err := azblobDriver.IsDirectory(artifact)
Expand Down

0 comments on commit 083f3a2

Please sign in to comment.