Commit bb60db97 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Display errors properly during ABI decoding

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