From 658d947e07fae1b4fb1b74bd7ea29ed9d1dc4155 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 1 Nov 2024 09:53:46 -0700 Subject: [PATCH] Fix a bug to only report unexpected errors --- shell/agents/Microsoft.Azure.Agent/ChatSession.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/agents/Microsoft.Azure.Agent/ChatSession.cs b/shell/agents/Microsoft.Azure.Agent/ChatSession.cs index afe88f15..c0156903 100644 --- a/shell/agents/Microsoft.Azure.Agent/ChatSession.cs +++ b/shell/agents/Microsoft.Azure.Agent/ChatSession.cs @@ -132,8 +132,9 @@ private async Task SetupNewChat(IStatusContext context, CancellationToke } catch (Exception e) { - if (e is not OperationCanceledException and TokenRequestException) + if (e is not OperationCanceledException and not TokenRequestException) { + // Trace a telemetry for any unexpected error. Telemetry.Trace(AzTrace.Exception("Failed to setup a new chat session."), e); }