Skip to content

Commit

Permalink
Merge pull request #2 from praveen-klaytn/dev
Browse files Browse the repository at this point in the history
Handled Polkadot errors
  • Loading branch information
praveen-kaia authored Jun 25, 2024
2 parents 0cbdd35 + 0937361 commit f54da47
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions polkadot-tx-latency-measurement/sendtx_polkadot.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,20 @@ async function sendTx(){
}
})
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute polkadot, ${err.toString()}, ${err.stack}`);
console.log("failed to execute.", err.toString(), err.stack)
data.error = err.toString()
console.log(`${data.executedAt},${data.chainId},${data.txhash},${data.startTime},${data.endTime},${data.latency},${data.txFee},${data.txFeeInUSD},${data.resourceUsedOfLatestBlock},${data.numOfTxInLatestBlock},${data.pingTime},${data.error}`)
const errorCode = `${data.executedAt},${data.chainId},${data.txhash},${data.startTime},${data.endTime},${data.latency},${data.txFee},${data.txFeeInUSD},${data.resourceUsedOfLatestBlock},${data.numOfTxInLatestBlock},${data.pingTime},${data.error}`

if (err.toString().includes("RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Transaction has a bad signature")) {
console.log(err)
sendSlackMsg(`Polkadot submitAndWatchExtrinsic: ${err.toString()}`)
process.exit(1);
} else {
const now = new Date();
await sendSlackMsg(`${now}, failed to execute polkadot, ${err.toString()}, ${err.stack}`);
console.log("failed to execute.", err.toString(), err.stack)
console.log(errorCode)
}

}
}

Expand Down

0 comments on commit f54da47

Please sign in to comment.