transactions - ensure err is defined when setting tx failed (#5801)

feature/default_network_editable
Frankie 6 years ago committed by GitHub
parent 3b1e73eff8
commit 97c1e6bcc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      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')
}

Loading…
Cancel
Save