Skip to content

Commit

Permalink
fix(filecredsource.go): improve error message in subjectToken functio…
Browse files Browse the repository at this point in the history
…n to include the actual error detail
  • Loading branch information
kaovilai committed Oct 22, 2024
1 parent 3e64809 commit 0f0ed90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion google/externalaccount/filecredsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (cs fileCredentialSource) credentialSourceType() string {
func (cs fileCredentialSource) subjectToken() (string, error) {
tokenFile, err := os.Open(cs.File)
if err != nil {
return "", fmt.Errorf("oauth2/google/externalaccount: failed to open credential file %q", cs.File)
return "", fmt.Errorf("oauth2/google/externalaccount: failed to open credential file %q due to %v", cs.File, err)
}
defer tokenFile.Close()
tokenBytes, err := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20))
Expand Down

0 comments on commit 0f0ed90

Please sign in to comment.