Build with .NET 7.0.200 + Async improvements (#1869)

This commit is contained in:
Cheena Malhotra
2023-02-17 09:54:20 -08:00
committed by GitHub
parent 675427c690
commit 86a8861e78
7 changed files with 7 additions and 7 deletions

View File

@@ -353,7 +353,7 @@ namespace Microsoft.SqlTools.Hosting.Protocol
}
catch (Exception e)
{
if (!(e is AggregateException && ((AggregateException)e).InnerExceptions[0] is TaskCanceledException))
if (!(e is AggregateException exception && exception.InnerExceptions[0] is TaskCanceledException))
{
// Log the error but don't rethrow it to prevent any errors in the handler from crashing the service
Logger.Write(TraceEventType.Error, string.Format("An unexpected error occurred in the request handler: {0}", e.ToString()));