Skip to content

Add OperationCanceledException exceptions automatically #9362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
<summary>Asynchronously gets a string from the specified cache with the specified key.</summary>
<returns>A task that gets the string value from the stored cache key.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Set">
Expand Down Expand Up @@ -257,6 +258,7 @@
<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>
<exception cref="T:System.ArgumentNullException">
<paramref name="key" /> or <paramref name="value" /> is null.</exception>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="SetString">
Expand Down Expand Up @@ -445,6 +447,7 @@
<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>
<exception cref="T:System.ArgumentNullException">
<paramref name="key" /> or <paramref name="value" /> is null.</exception>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="SetStringAsync">
Expand Down Expand Up @@ -487,6 +490,7 @@
<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>
<exception cref="T:System.ArgumentNullException">
<paramref name="key" /> or <paramref name="value" /> is null.</exception>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
</Members>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<summary>Gets a value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or null.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Refresh">
Expand Down Expand Up @@ -220,6 +221,7 @@
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Remove">
Expand Down Expand Up @@ -314,6 +316,7 @@
<summary>Removes the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Set">
Expand Down Expand Up @@ -420,6 +423,7 @@
<summary>Sets the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
</Members>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
<summary>Gets a value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or <see langword="null" />.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Refresh">
Expand Down Expand Up @@ -328,6 +329,7 @@
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Remove">
Expand Down Expand Up @@ -431,6 +433,7 @@
<summary>Removes the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Set">
Expand Down Expand Up @@ -546,6 +549,7 @@
<summary>Sets the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
</Members>
Expand Down
4 changes: 4 additions & 0 deletions xml/Microsoft.Extensions.Caching.Redis/RedisCache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
<summary>Gets a value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or <see langword="null" />.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Refresh">
Expand Down Expand Up @@ -263,6 +264,7 @@
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Remove">
Expand Down Expand Up @@ -354,6 +356,7 @@
<summary>Removes the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Set">
Expand Down Expand Up @@ -457,6 +460,7 @@
<summary>Sets the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
</Members>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<summary>Gets a value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the located value or <see langword="null" />.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Refresh">
Expand Down Expand Up @@ -244,6 +245,7 @@
<summary>Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Remove">
Expand Down Expand Up @@ -339,6 +341,7 @@
<summary>Removes the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
<Member MemberName="Set">
Expand Down Expand Up @@ -446,6 +449,7 @@
<summary>Sets the value with the given key.</summary>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<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>
<exception cref="T:System.OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
</Docs>
</Member>
</Members>
Expand Down
Loading