From 2afd0fc19e3597d7736a6c7a12617f2fc25752c6 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 30 Nov 2024 18:15:41 +0800 Subject: refactor: error handling for run-tool/run-agent scripts (#133) --- scripts/run-agent.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'scripts/run-agent.js') diff --git a/scripts/run-agent.js b/scripts/run-agent.js index 361d904..44cc39f 100755 --- a/scripts/run-agent.js +++ b/scripts/run-agent.js @@ -180,11 +180,7 @@ async function dumpResult() { process.stdout.write(`\x1b[2m----------------------\n${data}\n----------------------\x1b[0m\n`); } -(async () => { - try { - await main(); - } catch (err) { - console.error(err?.message || err); - process.exit(1); - } -})(); +main().catch((err) => { + console.error(err); + process.exit(1); +}); \ No newline at end of file -- cgit v1.2.3