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 {
|
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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue