enhance error handling

This commit is contained in:
Matias Alejo Garcia 2017-01-16 16:00:09 -03:00
commit f063c06751
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
17 changed files with 62 additions and 52 deletions

View file

@ -20,7 +20,12 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.generatingAddress = true;
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
if (err) {
//Error is already formated
return popupService.showAlert(err);
}
$scope.addr = addr;
if ($scope.walletAddrs[$scope.wallet.id]) $scope.walletAddrs[$scope.wallet.id] = addr;
$timeout(function() {
@ -129,7 +134,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.updateCurrentWallet = function() {
walletService.getStatus($scope.wallet, {}, function(err, status) {
if (err) {
$log.error(err);
return popupService.showAlert(bwcError.msg(err, gettextCatalog.getString('Could not update wallet')));
}
$timeout(function() {
$scope.wallet = profileService.getWallet($scope.wallet.id);