better error on recreate2

This commit is contained in:
Matias Alejo Garcia 2015-04-27 14:14:51 -03:00
commit e844086ac4

View file

@ -246,13 +246,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}; };
self.handleError = function(err) { self.handleError = function(err) {
$log.debug('ERROR:', err); $log.warn('Client ERROR:', err);
if (err.code === 'NOTAUTHORIZED') { if (err.code === 'NOTAUTHORIZED') {
$scope.$emit('Local/NotAuthorized'); $scope.$emit('Local/NotAuthorized');
} else if (err.code === 'NOTFOUND') { } else if (err.code === 'NOTFOUND') {
$scope.$emit('Local/BWSNotFound'); $scope.$emit('Local/BWSNotFound');
} else { } else {
$scope.$emit('Local/ClientError', err); $scope.$emit('Local/ClientError', (err.error ? err.error : err);
} }
}; };
self.openWallet = function() { self.openWallet = function() {
@ -448,8 +448,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.setOngoingProcess('recreating', false); self.setOngoingProcess('recreating', false);
if (err) { if (err) {
$log.error(err); self.handleError(err);
self.clientError('Could not recreate wallet:' + (err.error ? err.error : err));
$rootScope.$apply(); $rootScope.$apply();
return; return;
} }
@ -486,7 +485,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (err) { if (err) {
if (self.walletId == walletId) if (self.walletId == walletId)
self.setOngoingProcess('scanning', false); self.setOngoingProcess('scanning', false);
self.clientError('Could not scan wallet:' + err); self.handleError(err);
$rootScope.$apply(); $rootScope.$apply();
} }
}); });