Skip to content

Commit a0032b4

Browse files
Used OperationCanceledException instead of TaskCanceledException,
1 parent 2e7ce96 commit a0032b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Open.ChannelExtensions.Tests/CancellationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ await range
6464
}
6565
catch (Exception ex)
6666
{
67-
Assert.IsType<TaskCanceledException>(ex);
67+
Assert.IsType<OperationCanceledException>(ex);
6868
}
6969

7070
Assert.Equal(1, count);
@@ -97,7 +97,7 @@ await range
9797
}
9898
catch (Exception ex)
9999
{
100-
Assert.IsType<TaskCanceledException>(ex);
100+
Assert.IsType<OperationCanceledException>(ex);
101101
}
102102

103103
Assert.Equal(1, count);

Open.ChannelExtensions/Extensions.Read.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static async ValueTask<long> ReadUntilCancelledAsync<T>(this ChannelReade
107107
!cancellationToken.IsCancellationRequested
108108
&& await reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false));
109109
}
110-
catch (TaskCanceledException)
110+
catch (OperationCanceledException)
111111
{
112112
// In case WaitToReadAsync is cancelled.
113113
}

0 commit comments

Comments
 (0)