better handing of errors + prevent joining the same wallet more that once

This commit is contained in:
Matias Alejo Garcia 2015-08-12 11:08:33 -03:00
commit 033f7c163f
7 changed files with 167 additions and 79 deletions

View file

@ -1,7 +1,7 @@
'use strict';
'use strict';
angular.module('copayApp.services')
.factory('addressService', function(storageService, profileService, $log, $timeout, lodash) {
.factory('addressService', function(storageService, profileService, $log, $timeout, lodash, bwsError, gettext) {
var root = {};
@ -34,8 +34,7 @@ angular.module('copayApp.services')
root._createAddress(walletId, cb);
}, 5000);
}
$log.debug('Creating address ERROR:', err);
return cb(err);
return bwsError.cb(err, gettext('Could not create address'), cb);
}
return cb(null, addr.address);
});