add catch block
This commit is contained in:
parent
dfc92478e2
commit
083ce1d18b
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue