From 0f0ed90f5e02fb3dbc962a4a720cab26d121ced5 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Tue, 22 Oct 2024 12:04:58 -0500 Subject: [PATCH] fix(filecredsource.go): improve error message in subjectToken function to include the actual error detail --- google/externalaccount/filecredsource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/externalaccount/filecredsource.go b/google/externalaccount/filecredsource.go index 33766b972..cdd28b45f 100644 --- a/google/externalaccount/filecredsource.go +++ b/google/externalaccount/filecredsource.go @@ -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))