mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
transactions - ensure err is defined when setting tx failed (#5801)
This commit is contained in:
parent
3b1e73eff8
commit
97c1e6bcc1
@ -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…
Reference in New Issue
Block a user