aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2018-11-27 03:00:58 +0800
committerGitHub <noreply@github.com>2018-11-27 03:00:58 +0800
commit97c1e6bcc145e60d6721ecba50d762791f94dc13 (patch)
tree70b36bd48bcdfdbabd5e1f088fd0be216e4a7998 /app/scripts
parent3b1e73eff8bc553877cee957a401aa502f64a1b6 (diff)
downloadtangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.tar
tangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.tar.gz
tangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.tar.bz2
tangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.tar.lz
tangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.tar.xz
tangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.tar.zst
tangerine-wallet-browser-97c1e6bcc145e60d6721ecba50d762791f94dc13.zip
transactions - ensure err is defined when setting tx failed (#5801)
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/controllers/transactions/tx-state-manager.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js
index 151082452..72d869fa8 100644
--- a/app/scripts/controllers/transactions/tx-state-manager.js
+++ b/app/scripts/controllers/transactions/tx-state-manager.js
@@ -361,13 +361,15 @@ class TransactionStateManager extends EventEmitter {
@param err {erroObject} - error object
*/
setTxStatusFailed (txId, err) {
+ const error = !err ? new Error('Internal metamask failure') : err
+
const txMeta = this.getTx(txId)
txMeta.err = {
- message: err.toString(),
- rpc: err.value,
- stack: err.stack,
+ message: error.toString(),
+ rpc: error.value,
+ stack: error.stack,
}
- this.updateTx(txMeta)
+ this.updateTx(txMeta, 'transactions:tx-state-manager#fail - add error')
this._setTxStatus(txId, 'failed')
}