try catch on formatAmount

This commit is contained in:
Ivan Socolsky 2015-06-30 18:16:08 -03:00
parent 8660f3b4a4
commit cbb1645369
2 changed files with 6 additions and 2 deletions

View File

@ -193,7 +193,11 @@ EmailService.prototype._getDataForTemplate = function(notification, recipient, c
var data = _.cloneDeep(notification.data);
data.subjectPrefix = _.trim(self.subjectPrefix) + ' ';
if (data.amount) {
data.amount = WalletUtils.formatAmount(+data.amount, recipient.unit) + ' ' + recipient.unit;
try {
data.amount = WalletUtils.formatAmount(+data.amount, recipient.unit) + ' ' + recipient.unit;
} catch (ex) {
return cb(new Error('Could not format amount', ex));
}
}
self.storage.fetchWallet(notification.walletId, function(err, wallet) {
if (err) return cb(err);

View File

@ -2,7 +2,7 @@
"name": "bitcore-wallet-service",
"description": "A service for Mutisig HD Bitcoin Wallets",
"author": "BitPay Inc",
"version": "0.0.39",
"version": "0.0.40",
"keywords": [
"bitcoin",
"copay",