mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-03 14:10:43 +00:00
fix MCP under seatbelt, improve error handling (#301)
This commit is contained in:
parent
b35a3856a2
commit
c58f879026
3 changed files with 11 additions and 1 deletions
|
|
@ -187,7 +187,15 @@ export class ToolRegistry {
|
|||
command: mcpServerCmd,
|
||||
stderr: 'pipe',
|
||||
});
|
||||
await this.mcpClient.connect(transport);
|
||||
try {
|
||||
await this.mcpClient.connect(transport);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'failed to start or connect to MCP server using ' +
|
||||
`command '${mcpServerCmd}'; \n${error}`,
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
this.mcpClient.onerror = (error) => {
|
||||
console.error('MCP ERROR', error.toString());
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue