Display errors properly during ABI decoding

pull/1/head
Alex Beregszaszi 9 years ago
parent 2af1a92096
commit bb60db97c6
  1. 12
      assets/js/universal-dapp.js

@ -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) {

Loading…
Cancel
Save