Skip to content

Commit

Permalink
fix(cmd): If client fails to connect to Keyfactor then error is outpu…
Browse files Browse the repository at this point in the history
…t to the console rather than silently failing.
  • Loading branch information
spbsoluble committed Oct 27, 2022
1 parent d369d8b commit f5de9e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright © 2022 NAME HERE <EMAIL ADDRESS>
package cmd

import (
"fmt"
"github.com/Keyfactor/keyfactor-go-client/api"
"github.com/spf13/cobra"
"log"
Expand All @@ -24,7 +25,8 @@ func initClient() (*api.Client, error) {
c, err := api.NewKeyfactorClient(&clientAuth)

if err != nil {
log.Fatalf("Error creating Keyfactor client: %s", err)
fmt.Printf("Error connecting to Keyfactor: %s\n", err)
log.Fatalf("[ERROR] creating Keyfactor client: %s", err)
}
return c, err
}
Expand Down

0 comments on commit f5de9e9

Please sign in to comment.