Commit 9ae63da3 authored by yann300's avatar yann300

stringify error

parent 32d46d5f
...@@ -438,6 +438,17 @@ UniversalDApp.prototype.runTx = function (args, cb) { ...@@ -438,6 +438,17 @@ UniversalDApp.prototype.runTx = function (args, cb) {
if (!args.useCall) { if (!args.useCall) {
self.event.trigger('transactionExecuted', [error, args.to, args.data, false, result]) self.event.trigger('transactionExecuted', [error, args.to, args.data, false, result])
} }
if (error) {
if (typeof (error) !== 'string') {
if (error.message) {
error = error.message
} else {
try {
error = 'error: ' + JSON.stringify(error)
} catch (e) {}
}
}
}
callback(error, result) callback(error, result)
}) })
} }
......
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