Skip to content

Commit b3e18af

Browse files
committed
fix(stores): Return errors encountered during initClient
Signed-off-by: spbsoluble <1661003+spbsoluble@users.noreply.github.com>
1 parent 0c23904 commit b3e18af

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ func initClient(saveConfig bool) (*api.Client, error) {
601601
Err(envCfgErr).
602602
Msg("unable to authenticate to Keyfactor Command")
603603
log.Debug().Msg("return: initClient()")
604-
return nil, fmt.Errorf("unable to authenticate to Keyfactor Command")
604+
return nil, cfgErr
605605
}
606606

607607
// initGenClient initializes the SDK Command API client

cmd/stores.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ var storesListCmd = &cobra.Command{
5151
informDebug(debugFlag)
5252

5353
// Authenticate
54-
kfClient, _ := initClient(false)
54+
kfClient, cErr := initClient(false)
55+
if cErr != nil {
56+
log.Error().Err(cErr).Send()
57+
return cErr
58+
}
5559

5660
// CLI Logic
5761
params := make(map[string]interface{})

0 commit comments

Comments
 (0)