Skip to content

Commit

Permalink
Exit with error is the keyring can't be opened
Browse files Browse the repository at this point in the history
Same as done in `exec.go`
  • Loading branch information
simpson-ross committed Jun 28, 2023
1 parent bb1802d commit fceac03
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ var addCmd = &cobra.Command{
log.Fatal(err)
}

ring, _ := keyring.Open(keyringDefaults)
ring, err := keyring.Open(keyringDefaults)
if err != nil {
log.Fatalf("failed to open keyring backend: %s", strings.ToLower(err.Error()))
}

_ = ring.Set(keyring.Item{
Key: fmt.Sprintf("%s-%s", profileName, authType),
Expand Down

0 comments on commit fceac03

Please sign in to comment.