Skip to content

Commit

Permalink
add err info
Browse files Browse the repository at this point in the history
  • Loading branch information
huof6829 committed Jun 20, 2022
1 parent 5286308 commit cebfd20
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ioctl/newcmd/hdwallet/hdwalletimport.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ func NewHdwalletImportCmd(client ioctl.Client) *cobra.Command {
cmd.Println("Set password")
password, err := client.ReadSecret()
if err != nil {
return errors.New("failed to get password")
return errors.Wrap(err, "failed to get password")
}
cmd.Println("Enter password again")
passwordAgain, err := client.ReadSecret()
if err != nil {
return errors.New("failed to get password")
return errors.Wrap(err, "failed to get password")
}
if password != passwordAgain {
return ErrPasswdNotMatch
Expand All @@ -73,9 +73,8 @@ func NewHdwalletImportCmd(client ioctl.Client) *cobra.Command {
if err := client.WriteHdWalletConfigFile(mnemonic, password); err != nil {
return errors.Wrap(err, "failed to write to config file")
}

cmd.Printf("Mnemonic phrase: %s\n"+
"It is used to recover your wallet in case you forgot the password. Write them down and store it in a safe place.", mnemonic)
"It is used to recover your wallet in case you forgot the password. Write them down and store it in a safe place.\n", mnemonic)
return nil
},
}
Expand Down

0 comments on commit cebfd20

Please sign in to comment.