normalize bws error message

This commit is contained in:
Javier 2015-12-08 12:29:10 -03:00
commit 53a22dcd20

View file

@ -8,7 +8,7 @@ angular.module('copayApp.services')
prefix = prefix || '';
if (err && err.code) {
switch(err.code) {
switch (err.code) {
case 'CONNECTION_ERROR':
body = gettextCatalog.getString('Network connection error');
break;
@ -96,6 +96,9 @@ angular.module('copayApp.services')
case 'MAIN_ADDRESS_GAP_REACHED':
body = gettextCatalog.getString('Empty addresses limit reached. New addresses cannot be generated.');
break;
case 'WALLET_LOCKED':
body = gettextCatalog.getString('Wallet is locked');
break;
case 'ERROR':
body = (err.message || err.error);
@ -112,11 +115,11 @@ angular.module('copayApp.services')
body = gettextCatalog.getString(err);
}
var msg = prefix + ( body ? (prefix ? ': ' : '') + body : '');
var msg = prefix + (body ? (prefix ? ': ' : '') + body : '');
return msg;
};
root.cb = function (err,prefix, cb) {
root.cb = function(err, prefix, cb) {
return cb(root.msg(err, prefix))
};