better error message

This commit is contained in:
Matias Alejo Garcia 2016-06-07 17:11:57 -03:00
commit 64d099d15c
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
3 changed files with 47 additions and 18 deletions

View file

@ -543,8 +543,12 @@ angular.module('copayApp.services')
$log.debug('Importing Wallet xPrivKey');
walletClient.importFromExtendedPrivateKey(xPrivKey, opts, function(err) {
if (err)
if (err) {
if (err instanceof errors.NOT_AUTHORIZED)
return cb(err);
return bwsError.cb(err, gettext('Could not import'), cb);
}
root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl,
@ -571,8 +575,12 @@ angular.module('copayApp.services')
passphrase: opts.passphrase,
account: opts.account || 0,
}, function(err) {
if (err)
if (err) {
if (err instanceof errors.NOT_AUTHORIZED)
return cb(err);
return bwsError.cb(err, gettext('Could not import'), cb);
}
root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl,