Skip to content

Commit 99aef61

Browse files
authored
Add OperationCanceledException exceptions automatically (dotnet#9362)
1 parent 1c81e4b commit 99aef61

File tree

176 files changed

+16956
-16332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+16956
-16332
lines changed

xml/Microsoft.Extensions.Caching.Distributed/DistributedCacheExtensions.xml

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<summary>Asynchronously gets a string from the specified cache with the specified key.</summary>
146146
<returns>A task that gets the string value from the stored cache key.</returns>
147147
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetString(Microsoft.Extensions.Caching.Distributed.IDistributedCache,System.String)" />.</remarks>
148+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
148149
</Docs>
149150
</Member>
150151
<Member MemberName="Set">
@@ -257,6 +258,7 @@
257258
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.Set(Microsoft.Extensions.Caching.Distributed.IDistributedCache,System.String,System.Byte[])" />.</remarks>
258259
<exception cref="T:System.ArgumentNullException">
259260
<paramref name="key" /> or <paramref name="value" /> is null.</exception>
261+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
260262
</Docs>
261263
</Member>
262264
<Member MemberName="SetString">
@@ -445,6 +447,7 @@
445447
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.SetString(Microsoft.Extensions.Caching.Distributed.IDistributedCache,System.String,System.String)" />.</remarks>
446448
<exception cref="T:System.ArgumentNullException">
447449
<paramref name="key" /> or <paramref name="value" /> is null.</exception>
450+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
448451
</Docs>
449452
</Member>
450453
<Member MemberName="SetStringAsync">
@@ -487,6 +490,7 @@
487490
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.SetString(Microsoft.Extensions.Caching.Distributed.IDistributedCache,System.String,System.String,Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions)" />.</remarks>
488491
<exception cref="T:System.ArgumentNullException">
489492
<paramref name="key" /> or <paramref name="value" /> is null.</exception>
493+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
490494
</Docs>
491495
</Member>
492496
</Members>

xml/Microsoft.Extensions.Caching.Distributed/IDistributedCache.xml

+4
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
<summary>Gets a value with the given key.</summary>
127127
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or null.</returns>
128128
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.IDistributedCache.Get(System.String)" />.</remarks>
129+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
129130
</Docs>
130131
</Member>
131132
<Member MemberName="Refresh">
@@ -220,6 +221,7 @@
220221
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
221222
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
222223
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.IDistributedCache.Refresh(System.String)" />.</remarks>
224+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
223225
</Docs>
224226
</Member>
225227
<Member MemberName="Remove">
@@ -314,6 +316,7 @@
314316
<summary>Removes the value with the given key.</summary>
315317
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
316318
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.IDistributedCache.Remove(System.String)" />.</remarks>
319+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
317320
</Docs>
318321
</Member>
319322
<Member MemberName="Set">
@@ -420,6 +423,7 @@
420423
<summary>Sets the value with the given key.</summary>
421424
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
422425
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.IDistributedCache.Set(System.String,System.Byte[],Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions)" />.</remarks>
426+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
423427
</Docs>
424428
</Member>
425429
</Members>

xml/Microsoft.Extensions.Caching.Distributed/MemoryDistributedCache.xml

+4
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
<summary>Gets a value with the given key.</summary>
226226
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or <see langword="null" />.</returns>
227227
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.MemoryDistributedCache.Get(System.String)" />.</remarks>
228+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
228229
</Docs>
229230
</Member>
230231
<Member MemberName="Refresh">
@@ -328,6 +329,7 @@
328329
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
329330
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
330331
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.MemoryDistributedCache.Refresh(System.String)" />.</remarks>
332+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
331333
</Docs>
332334
</Member>
333335
<Member MemberName="Remove">
@@ -431,6 +433,7 @@
431433
<summary>Removes the value with the given key.</summary>
432434
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
433435
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.MemoryDistributedCache.Remove(System.String)" />.</remarks>
436+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
434437
</Docs>
435438
</Member>
436439
<Member MemberName="Set">
@@ -546,6 +549,7 @@
546549
<summary>Sets the value with the given key.</summary>
547550
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
548551
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Distributed.MemoryDistributedCache.Set(System.String,System.Byte[],Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions)" />.</remarks>
552+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
549553
</Docs>
550554
</Member>
551555
</Members>

xml/Microsoft.Extensions.Caching.Redis/RedisCache.xml

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
<summary>Gets a value with the given key.</summary>
173173
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or <see langword="null" />.</returns>
174174
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Redis.RedisCache.Get(System.String)" />.</remarks>
175+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
175176
</Docs>
176177
</Member>
177178
<Member MemberName="Refresh">
@@ -263,6 +264,7 @@
263264
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
264265
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
265266
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Redis.RedisCache.Refresh(System.String)" />.</remarks>
267+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
266268
</Docs>
267269
</Member>
268270
<Member MemberName="Remove">
@@ -354,6 +356,7 @@
354356
<summary>Removes the value with the given key.</summary>
355357
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
356358
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Redis.RedisCache.Remove(System.String)" />.</remarks>
359+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
357360
</Docs>
358361
</Member>
359362
<Member MemberName="Set">
@@ -457,6 +460,7 @@
457460
<summary>Sets the value with the given key.</summary>
458461
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
459462
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.Redis.RedisCache.Set(System.String,System.Byte[],Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions)" />.</remarks>
463+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
460464
</Docs>
461465
</Member>
462466
</Members>

xml/Microsoft.Extensions.Caching.SqlServer/SqlServerCache.xml

+4
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
<summary>Gets a value with the given key.</summary>
150150
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or <see langword="null" />.</returns>
151151
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.SqlServer.SqlServerCache.Get(System.String)" />.</remarks>
152+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
152153
</Docs>
153154
</Member>
154155
<Member MemberName="Refresh">
@@ -244,6 +245,7 @@
244245
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
245246
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
246247
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.SqlServer.SqlServerCache.Refresh(System.String)" />.</remarks>
248+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
247249
</Docs>
248250
</Member>
249251
<Member MemberName="Remove">
@@ -339,6 +341,7 @@
339341
<summary>Removes the value with the given key.</summary>
340342
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
341343
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.SqlServer.SqlServerCache.Remove(System.String)" />.</remarks>
344+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
342345
</Docs>
343346
</Member>
344347
<Member MemberName="Set">
@@ -446,6 +449,7 @@
446449
<summary>Sets the value with the given key.</summary>
447450
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
448451
<remarks>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:Microsoft.Extensions.Caching.SqlServer.SqlServerCache.Set(System.String,System.Byte[],Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions)" />.</remarks>
452+
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
449453
</Docs>
450454
</Member>
451455
</Members>

0 commit comments

Comments
 (0)