Display web3 encoding error (if arguments are not supplied by the user, etc.)

pull/1/head
Alex Beregszaszi 9 years ago
parent e44ceb831c
commit fdeae6bdf6
  1. 10
      assets/js/universal-dapp.js

@ -287,8 +287,14 @@ UniversalDApp.prototype.getCallButton = function(args) {
return;
}
var data = '';
if (!isConstructor || funArgs.length > 0)
data = args.encode(funArgs);
if (!isConstructor || funArgs.length > 0) {
try {
data = args.encode(funArgs);
} catch(e) {
replaceOutput($result, $('<span/>').text('Error encoding arguments: ' + e));
return;
}
}
if (data.slice(0, 9) == 'undefined')
data = data.slice(9);
if (data.slice(0, 2) == '0x') data = data.slice(2);

Loading…
Cancel
Save