Skip to content

Commit 006e4f9

Browse files
authored
Catch an error from agent (microsoft#205913)
1 parent 61f447b commit 006e4f9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/workbench/api/common/extHostChatAgents2.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,13 @@ export class ExtHostChatAgents2 implements ExtHostChatAgentsShape2 {
253253
}
254254

255255
const convertedHistory = await this.prepareHistoryTurns(agent.id, context);
256-
257-
return agent.provideSlashCommands({ history: convertedHistory }, token);
256+
try {
257+
return await agent.provideSlashCommands({ history: convertedHistory }, token);
258+
} catch (err) {
259+
const msg = toErrorMessage(err);
260+
this._logService.error(`[${agent.extension.identifier.value}] [@${agent.id}] Error while providing slash commands: ${msg}`);
261+
return [];
262+
}
258263
}
259264

260265
async $provideFollowups(request: IChatAgentRequest, handle: number, result: IChatAgentResult, token: CancellationToken): Promise<IChatFollowup[]> {

0 commit comments

Comments
 (0)