better error handler
This commit is contained in:
parent
959707f3b7
commit
a30845d686
5 changed files with 14 additions and 36 deletions
|
|
@ -178,8 +178,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
lodash.each($scope.wallets, function(wallet) {
|
||||
walletService.getStatus(wallet, {}, function(err, status) {
|
||||
if (err) {
|
||||
if (err === 'WALLET_NOT_REGISTERED') wallet.error = gettextCatalog.getString('Wallet not registered');
|
||||
else wallet.error = err;
|
||||
$log.error(err);
|
||||
} else {
|
||||
wallet.error = null;
|
||||
wallet.status = status;
|
||||
}
|
||||
if (++j == i) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
|
||||
var updateStatus = function(force) {
|
||||
$scope.updatingStatus = true;
|
||||
$scope.updateStatusError = false;
|
||||
$scope.updateStatusError = null;
|
||||
$scope.walletNotRegistered = false;
|
||||
|
||||
walletService.getStatus($scope.wallet, {
|
||||
|
|
@ -57,18 +57,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
if (err === 'WALLET_NOT_REGISTERED') {
|
||||
$scope.walletNotRegistered = true;
|
||||
} else {
|
||||
$scope.updateStatusError = true;
|
||||
$scope.updateStatusError = err;
|
||||
}
|
||||
$scope.status = null;
|
||||
return;
|
||||
} else {
|
||||
setPendingTxps(status.pendingTxps);
|
||||
$scope.status = status;
|
||||
}
|
||||
|
||||
setPendingTxps(status.pendingTxps);
|
||||
|
||||
$scope.status = status;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
|
@ -111,6 +109,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
if (err) return;
|
||||
$timeout(function() {
|
||||
walletService.startScan($scope.wallet, function() {
|
||||
$scope.updateAll();
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue