Commit bb60db97 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Display errors properly during ABI decoding

parent 2af1a920
......@@ -265,9 +265,14 @@ UniversalDApp.prototype.getCallButton = function(args) {
}
var getDecodedOutput = function (result) {
var $decoded = $('<ol>');
for (var i = 0; i < result.length; i++) {
$decoded.append($('<li>').text(result[i]));
var $decoded;
if (Array.isArray(result)) {
$decoded = $('<ol>');
for (var i = 0; i < result.length; i++) {
$decoded.append($('<li>').text(result[i]));
}
} else {
$decoded = result;
}
return $('<div class="decoded">').html('<strong>Decoded:</strong> ').append($decoded);
}
......@@ -371,6 +376,7 @@ UniversalDApp.prototype.getCallButton = function(args) {
$result.append(getDecodedOutput(decodedObj));
} catch (e) {
$result.append(getDecodedOutput('Failed to decode output: ' + e));
}
}
} else if (args.abi.constant && !isConstructor) {
......
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