Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
add stack traces to slack error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ara-klaytn committed May 9, 2024
1 parent 698cdce commit 4afdaa3
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 80 deletions.
10 changes: 5 additions & 5 deletions aptos-tx-latency-measurement/sendtx_aptos.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ async function sendTx() {
}
} catch (err) {
const now = new Date();
await sendSlackMsg(`${now}, failed to execute aptos, ${err.toString()}`);
console.log("failed to execute.", err.toString());
await sendSlackMsg(`${now}, failed to execute aptos, ${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}`)
}
Expand All @@ -266,19 +266,19 @@ async function main() {
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}
loadConfig();
try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
11 changes: 6 additions & 5 deletions arbitrium-tx-latency-measurement/sendtx_arbitrium.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ async function sendTx() {
// 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}`)
} catch (err) {
const now = new Date();
await sendSlackMsg(`${now}, failed to execute arbitrum, ${err.toString()}`);
console.log("failed to execute.", err.toString());
await sendSlackMsg(`${now}, failed to execute arbitrum, ${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}`)
}
Expand Down Expand Up @@ -311,6 +311,7 @@ async function l1commitmentprocess(db, hash, createdAt) {
};

const response = await fetch(`${process.env.L1FINALITYSCRAPERURL}/root_end?from_chain=42161&hash=${hash}`);
console.log("l1GoResponseArb", response);
if (!response.ok) {
const postIndex = db.data.posts.findIndex((post) => post.l2TxHash === hash);
if (postIndex !== -1) {
Expand Down Expand Up @@ -361,13 +362,13 @@ async function main() {
await sendTx()
await l1Checker();
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

Expand All @@ -376,5 +377,5 @@ try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions avalanche-tx-latency-measurement/sendtx_avalanche.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ const sendAvax = async (amount, to, maxFeePerGas = undefined, maxPriorityFeePerG
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute avalanche, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute avalanche, ${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}`)
}
Expand Down Expand Up @@ -273,18 +273,18 @@ async function main(){
try{
await sendAvax("0.0", address);
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendAvax("0.0", address);
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}
try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions bnb-tx-latency-measurement/sendtx_bnb.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ async function sendTx(){
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute bnb, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute bnb, ${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}`)
}
Expand All @@ -248,19 +248,19 @@ async function main(){
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions elrond-tx-latency-measurement/sendtx_elrond.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ async function sendTx(){
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute elrond, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute elrond, ${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}`)
}
Expand Down Expand Up @@ -273,19 +273,19 @@ async function main(){
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions eos-tx-latency-measurement/sendtx_eos.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ async function sendTx(){
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute eos, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute eos, ${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}`)
}
Expand All @@ -234,19 +234,19 @@ async function main(){
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions fantom-tx-latency-measurement/sendtx_fantom.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ async function sendTx(){
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute fantom, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute fantom, ${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}`)
}
Expand All @@ -269,19 +269,19 @@ async function main(){
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions harmony-tx-latency-measurement/sendtx_harmony.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ async function sendTx() {
}
} catch (err) {
const now = new Date();
await sendSlackMsg(`${now}, failed to execute harmony, ${err.toString()}`);
console.log("failed to execute.", err.toString());
await sendSlackMsg(`${now}, failed to execute harmony, ${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}`)
}
Expand All @@ -257,19 +257,19 @@ async function main() {
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions hedera-tx-latency-measurement/sendtx_hedera.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ async function sendTx(){
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute hedera, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute hedera, ${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}`)
}
Expand All @@ -235,19 +235,19 @@ async function main(){
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions klaytn-tx-latency-measurement/sendtx_klaytn.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ async function sendTx() {
}
} catch (err) {
const now = new Date();
await sendSlackMsg(`${now}, failed to execute Klaytn, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute Klaytn, ${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}`)
}
Expand All @@ -240,19 +240,19 @@ async function main() {
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}
loadConfig();
try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
10 changes: 5 additions & 5 deletions near-tx-latency-measurement/sendtx_near.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ async function sendTx() {
}
} catch(err){
const now = new Date();
await sendSlackMsg(`${now}, failed to execute Near, ${err.toString()}`);
console.log("failed to execute.", err.toString())
await sendSlackMsg(`${now}, failed to execute Near, ${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}`)
}
Expand All @@ -318,13 +318,13 @@ async function main (){
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}, interval)
try{
await sendTx()
} catch(err){
console.log("failed to execute sendTx", err.toString())
console.log("failed to execute sendTx", err.toString(), err.stack)
}
}

Expand All @@ -336,5 +336,5 @@ try{
main()
}
catch(err){
console.log("failed to execute main", err.toString())
console.log("failed to execute main", err.toString(), err.stack)
}
Loading

0 comments on commit 4afdaa3

Please sign in to comment.