github.com/neatlab/neatio@v1.7.3-0.20220425043230-d903e92fcc75/chain/accounts/errors.go (about) 1 package accounts 2 3 import ( 4 "errors" 5 "fmt" 6 ) 7 8 var ErrUnknownAccount = errors.New("unknown account") 9 10 var ErrUnknownWallet = errors.New("unknown wallet") 11 12 var ErrNotSupported = errors.New("not supported") 13 14 var ErrInvalidPassphrase = errors.New("invalid passphrase") 15 16 var ErrWalletAlreadyOpen = errors.New("wallet already open") 17 18 var ErrWalletClosed = errors.New("wallet closed") 19 20 type AuthNeededError struct { 21 Needed string 22 } 23 24 func NewAuthNeededError(needed string) error { 25 return &AuthNeededError{ 26 Needed: needed, 27 } 28 } 29 30 func (err *AuthNeededError) Error() string { 31 return fmt.Sprintf("authentication needed: %s", err.Needed) 32 }