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