Change DiagnosticsHandler to special-case base cancellation exception (dotnet/corefx...
authorStephen Toub <stoub@microsoft.com>
Mon, 17 Jun 2019 20:25:23 +0000 (16:25 -0400)
committerGitHub <noreply@github.com>
Mon, 17 Jun 2019 20:25:23 +0000 (16:25 -0400)
It should be treating all OperationCanceledExceptions as cancellation, not just TaskCanceledException.

Commit migrated from https://github.com/dotnet/corefx/commit/dd6b0669bec5ac3b72b2b3a015f42c403c3ec0f1

src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs

index fada51d..951f56e 100644 (file)
@@ -111,7 +111,7 @@ namespace System.Net.Http
 
                 return await responseTask.ConfigureAwait(false);
             }
-            catch (TaskCanceledException)
+            catch (OperationCanceledException)
             {
                 // we'll report task status in HttpRequestOut.Stop
                 throw;