Skip to content

Commit 081126b

Browse files
committed
Error handling
1 parent 159b248 commit 081126b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

js/ethplorer.js

+11
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ Ethplorer = {
308308
}else{
309309
titleAdd += 'Operation';
310310
$('.token-operation-type').text('Operation');
311+
if(oTx.receipt && oTx.receipt.logs && oTx.receipt.logs.length){
312+
for(var i=0; i<oTx.receipt.logs.length; i++){
313+
var log = oTx.receipt.logs[i];
314+
// Error event
315+
if(log.topics && log.topics.length && (0 === log.topics[0].indexOf('0x19f3a4'))){
316+
oTx.success = false;
317+
oTx.failedReason = Ethplorer.Utils.hex2ascii(log.data.substr(192))
318+
break;
319+
}
320+
}
321+
}
311322
if(oTx.blockNumber){
312323
$('#txTokenStatus')[oTx.success ? 'removeClass' : 'addClass']('text-danger');
313324
$('#txTokenStatus')[oTx.success ? 'addClass' : 'removeClass']('text-success');

0 commit comments

Comments
 (0)