aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/transactions/index.js
diff options
context:
space:
mode:
authorAnton <anton@chainsecurity.com>2018-05-29 04:57:08 +0800
committerAnton <anton@chainsecurity.com>2018-05-29 04:57:08 +0800
commit71a6e97327a4c759942784ee81505e3bc5ed545e (patch)
treea7ac713e5b2f0cd700d3e55203ec56ce089a2414 /app/scripts/controllers/transactions/index.js
parent1d23a5c81b03b8b52225e942603c84b237d4e63c (diff)
downloadtangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.tar
tangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.tar.gz
tangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.tar.bz2
tangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.tar.lz
tangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.tar.xz
tangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.tar.zst
tangerine-wallet-browser-71a6e97327a4c759942784ee81505e3bc5ed545e.zip
cleanErrorStack moved to separate library module
more errors traces cleaned up
Diffstat (limited to 'app/scripts/controllers/transactions/index.js')
-rw-r--r--app/scripts/controllers/transactions/index.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index 6609b80b0..aff5db984 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -8,6 +8,7 @@ const TxGasUtil = require('./tx-gas-utils')
const PendingTransactionTracker = require('./pending-tx-tracker')
const NonceTracker = require('./nonce-tracker')
const txUtils = require('./lib/util')
+const cleanErrorStack = require('../../lib/cleanErrorStack')
const log = require('loglevel')
/**
@@ -112,15 +113,6 @@ class TransactionController extends EventEmitter {
}
/**
- Returns error without stack trace for better UI display
- @param {Error} err - error which stack will be cleaned
- */
- cleanErrorStack(err){
- err.stack = err.name + ': ' + err.message
- return err
- }
-
- /**
add a new unapproved transaction to the pipeline
@returns {Promise<string>} the hash of the transaction after being submitted to the network
@@ -140,11 +132,11 @@ class TransactionController extends EventEmitter {
case 'submitted':
return resolve(finishedTxMeta.hash)
case 'rejected':
- return reject(this.cleanErrorStack(new Error('MetaMask Tx Signature: User denied transaction signature.')))
+ return reject(cleanErrorStack(new Error('MetaMask Tx Signature: User denied transaction signature.')))
case 'failed':
- return reject(this.cleanErrorStack(new Error(finishedTxMeta.err.message)))
+ return reject(cleanErrorStack(new Error(finishedTxMeta.err.message)))
default:
- return reject(this.cleanErrorStack(new Error(`MetaMask Tx Signature: Unknown problem: ${JSON.stringify(finishedTxMeta.txParams)}`)))
+ return reject(cleanErrorStack(new Error(`MetaMask Tx Signature: Unknown problem: ${JSON.stringify(finishedTxMeta.txParams)}`)))
}
})
})