Skip to content

Commit 0f0ed90

Browse files
committed
fix(filecredsource.go): improve error message in subjectToken function to include the actual error detail
1 parent 3e64809 commit 0f0ed90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google/externalaccount/filecredsource.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (cs fileCredentialSource) credentialSourceType() string {
2626
func (cs fileCredentialSource) subjectToken() (string, error) {
2727
tokenFile, err := os.Open(cs.File)
2828
if err != nil {
29-
return "", fmt.Errorf("oauth2/google/externalaccount: failed to open credential file %q", cs.File)
29+
return "", fmt.Errorf("oauth2/google/externalaccount: failed to open credential file %q due to %v", cs.File, err)
3030
}
3131
defer tokenFile.Close()
3232
tokenBytes, err := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20))

0 commit comments

Comments
 (0)