diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-03-23 02:33:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 02:33:56 +0800 |
commit | b5b88392b9cd16893c7b9222040c8222ccf72ce0 (patch) | |
tree | 7905684ce3f6aed33be03c9a6f8892f8bc2e0cc4 /app/scripts | |
parent | 9906da86a4669c1eaf7f693398de380b2973bfe8 (diff) | |
parent | 864f8b06f9f2ec56b7ffce0afe83a1d70c3c7843 (diff) | |
download | tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.tar tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.tar.gz tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.tar.bz2 tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.tar.lz tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.tar.xz tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.tar.zst tangerine-wallet-browser-b5b88392b9cd16893c7b9222040c8222ccf72ce0.zip |
Merge branch 'master' into i1237-xmlfix2
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/transaction-manager.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js index c6cfdf11d..31c1c8431 100644 --- a/app/scripts/transaction-manager.js +++ b/app/scripts/transaction-manager.js @@ -172,7 +172,10 @@ module.exports = class TransactionManager extends EventEmitter { ], (err) => { self.nonceLock.leave() if (err) { - this.setTxStatusFailed(txId) + this.setTxStatusFailed(txId, { + errCode: err.errCode || err, + message: err.message || 'Transaction failed during approval', + }) return cb(err) } cb() @@ -291,7 +294,10 @@ module.exports = class TransactionManager extends EventEmitter { this._setTxStatus(txId, 'confirmed') } - setTxStatusFailed (txId) { + setTxStatusFailed (txId, reason) { + let txMeta = this.getTx(txId) + txMeta.err = reason + this.updateTx(txMeta) this._setTxStatus(txId, 'failed') } @@ -312,12 +318,11 @@ module.exports = class TransactionManager extends EventEmitter { var txHash = txMeta.hash var txId = txMeta.id if (!txHash) { - txMeta.err = { + let errReason = { errCode: 'No hash was provided', message: 'We had an error while submitting this transaction, please try again.', } - this.updateTx(txMeta) - return this.setTxStatusFailed(txId) + return this.setTxStatusFailed(txId, errReason) } this.txProviderUtils.query.getTransactionByHash(txHash, (err, txParams) => { if (err || !txParams) { |