511
512
private reportError(reasonForTelemetry: string, message: string, error?: Error): void {
514
>
515
>
if (fileOperationReason === FileOperationResult.FILE_NOT_FOUND) {
516
// Expected case (e.g. reading a non-existent session); keep noise low
517
this.logService.trace(`ChatSessionStore: ` + message, toErrorMessage(error));
519
>
// Unexpected or serious error; surface at error level
520
>
this.logService.error(`ChatSessionStore: ` + message, toErrorMessage(error));
521
>
}
522
>
type ChatSessionStoreErrorData = {
523
>
reason: string;
524
>
fileOperationReason: number;
525
>
// error: Error;
526
>
};
527
>
type ChatSessionStoreErrorClassification = {
528
>
owner: 'roblourens';
529
>
comment: 'Detect issues related to managing chat sessions';
530
>
reason: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Info about the error that occurred' };
531
>
fileOperationReason: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'An error code from the file service' };
532
>
// error: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Info about the error that occurred' };
533
>
};
534
>
this.telemetryService.publicLog2<ChatSessionStoreErrorData, ChatSessionStoreErrorClassification>('chatSessionStoreError', {
535
>
reason: reasonForTelemetry,
536
>
fileOperationReason: fileOperationReason ?? -1
537
>
});
538
>
}
539
540
private indexCache: IChatSessionIndexData | undefined;