add more error messages for init command
This commit is contained in:
parent
b813e1743f
commit
8be3d6ebcb
|
@ -162,6 +162,7 @@ func commandInstall(i *actionsets.Installer) error {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
fmt.Printf("installation can take a while...\n")
|
||||
err = i.Install(f, *flagOverwrite)
|
||||
if err != nil {
|
||||
fail("installation error", "error", err)
|
||||
|
|
|
@ -70,12 +70,20 @@ func (i *Installer) Init() (*lightwallet.Secrets, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
cardPubKey, err := actions.SelectNotInitialized(i.c, walletAID)
|
||||
info, err := actions.Select(i.c, walletAID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = actions.Init(i.c, cardPubKey, secrets, walletAID)
|
||||
if !info.Installed {
|
||||
return nil, fmt.Errorf("applet not installed")
|
||||
}
|
||||
|
||||
if info.Initialized {
|
||||
return nil, fmt.Errorf("card already initialized")
|
||||
}
|
||||
|
||||
err = actions.Init(i.c, info.PublicKey, secrets, walletAID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue