Mercurial > go > multipass
changeset 7:406d3cd76739
Report errors to the user.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sat, 24 Oct 2015 23:40:13 -0400 |
parents | 10613f0f4737 |
children | 4db389f948c9 |
files | multipass-add.go |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/multipass-add.go Sat Oct 24 23:33:16 2015 -0400 +++ b/multipass-add.go Sat Oct 24 23:40:13 2015 -0400 @@ -18,14 +18,19 @@ text, err := reader.ReadString('\n') if err != nil { fmt.Println(err.Error()) - return + os.Exit(1) } text = text[:len(text)-1] entry, password, err := auth.NewEntry(text) if err != nil { fmt.Println(err.Error()) - return + os.Exit(1) } - passfile.Add(entry) + err = passfile.Add(entry) + if err != nil { + fmt.Println("Couldn't create a password:") + fmt.Println(err.Error()) + os.Exit(1) + } fmt.Printf("New password: %s\n", password) }