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 { try {
await mcpClient.connectToServer(process.argv[2]); await mcpClient.connectToServer(process.argv[2]);
await mcpClient.chatLoop(); await mcpClient.chatLoop();
} catch (e) {
console.error("Error:", e);
await mcpClient.cleanup();
process.exit(1);
} finally { } finally {
await mcpClient.cleanup(); await mcpClient.cleanup();
process.exit(0); process.exit(0);