Use btcjson.ErrWallet for createencryptedwallet.

If an unexpected error is encounted when creating the encrypted
wallet, rather than using btcjson.ErrInternal, wrap the error message
using btcjson.ErrWallet.Code.
This commit is contained in:
Josh Rickmar 2014-05-30 09:31:42 -05:00
parent 55564dc31f
commit 733677433d

View file

@ -1721,7 +1721,10 @@ func CreateEncryptedWallet(icmd btcjson.Cmd) (interface{}, *btcjson.Error) {
return nil, &ErrBtcdDisconnected return nil, &ErrBtcdDisconnected
default: // all other non-nil errors default: // all other non-nil errors
return nil, &btcjson.ErrInternal return nil, &btcjson.Error{
Code: btcjson.ErrWallet.Code,
Message: err.Error(),
}
} }
} }