Proactive.GetConversationWithThrowAsync(String, CancellationToken) Method

Definition

Retrieves the conversation with the specified identifier asynchronously, throwing an exception if the conversation does not exist.

public System.Threading.Tasks.Task<Microsoft.Agents.Builder.App.Proactive.Conversation?> GetConversationWithThrowAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default);
member this.GetConversationWithThrowAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Builder.App.Proactive.Conversation>
Public Function GetConversationWithThrowAsync (conversationId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Conversation)

Parameters

conversationId
String

The unique identifier of the conversation to retrieve. Cannot be null or empty.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

A task that represents the asynchronous operation. The task result contains the conversation if found.

Remarks

If no conversation is found for the specified identifier, a KeyNotFoundException is thrown. Use this method when the absence of a conversation should be treated as an error.

Applies to