White-Whale-Defi-Platform / white-whale-bots

A single-chain and multi-dex arbitrage bot the utilizing White Whale flash loans and Skip Protocol.
https://whitewhale.money
MIT License
83 stars 32 forks source link

Log error on bot exit in main().catch(..) #10

Closed SirTLB closed 1 year ago

SirTLB commented 1 year ago

Improvement description

Have the bot log on exit. For now, the bot just calls process.exit on a error so the bot exists. To see the error that actually occurred and made the bot exit, make sure it also logs the obtained error and then exits using process.exit.

SirTLB commented 1 year ago

@kaimen-sano I'd say we change the .catch() in main to: main().catch(e => {console.log(e), process.exit()})

kaimen-sano commented 1 year ago

Yep, but we should be specifying a non-zero exit code to indicate that an error occurred.

main().catch((e) => {
    console.error(e);
    process.exit(1);
});

would be a good starting point for something appropriate to do.

SirTLB commented 1 year ago

Ok. PR is up