Skip to content

Commit d6d5034

Browse files
authored
Fix throwing out of catch (microsoft#252126)
Part of microsoft/vscode-copilot-release#9802
1 parent 6edba30 commit d6d5034

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/chat/common/chatServiceImpl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ export class ChatService extends Disposable implements IChatService {
884884
});
885885
}
886886
} catch (err) {
887+
this.logService.error(`Error while handling chat request: ${toErrorMessage(err, true)}`);
887888
const result = 'error';
888889
this.telemetryService.publicLog2<ChatProviderInvokedEvent, ChatProviderInvokedClassification>('interactiveSessionProviderInvoked', {
889890
timeToFirstProgress: undefined,
@@ -899,10 +900,9 @@ export class ChatService extends Disposable implements IChatService {
899900
numCodeBlocks: 0,
900901
enableCommandDetection,
901902
isParticipantDetected: !!detectedAgent,
902-
attachmentKinds: this.attachmentKindsForTelemetry(request.variableData),
903+
attachmentKinds: request ? this.attachmentKindsForTelemetry(request.variableData) : [],
903904
model: this.resolveModelId(options?.userSelectedModelId)
904905
});
905-
this.logService.error(`Error while handling chat request: ${toErrorMessage(err, true)}`);
906906
if (request) {
907907
const rawResult: IChatAgentResult = { errorDetails: { message: err.message } };
908908
model.setResponse(request, rawResult);

0 commit comments

Comments
 (0)