Commit 691ec1cf authored by yann300's avatar yann300

try catch on sendTransation (metamask can throw)

parent 780e93b3
......@@ -64,6 +64,7 @@ TxRunner.prototype.execute = function (args, callback) {
}
tx.gas = gasEstimation
var sendTransaction = self.personalMode ? executionContext.web3().personal.sendTransaction : executionContext.web3().eth.sendTransaction
try {
sendTransaction(tx, function (err, resp) {
if (err) {
return callback(err, resp)
......@@ -71,6 +72,9 @@ TxRunner.prototype.execute = function (args, callback) {
tryTillResponse(resp, callback)
})
} catch (e) {
return callback(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
}
})
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment