add catch block

This commit is contained in:
Tony Dang 2025-05-09 09:03:58 -07:00
commit 083ce1d18b
No known key found for this signature in database

View file

@ -184,6 +184,10 @@ async function main() {
try {
await mcpClient.connectToServer(process.argv[2]);
await mcpClient.chatLoop();
} catch (e) {
console.error("Error:", e);
await mcpClient.cleanup();
process.exit(1);
} finally {
await mcpClient.cleanup();
process.exit(0);