Skip to content

Instantly share code, notes, and snippets.

@neuecc
Last active August 3, 2022 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neuecc/4cac82cf6e1c4dfbae8c365d15dec632 to your computer and use it in GitHub Desktop.
Save neuecc/4cac82cf6e1c4dfbae8c365d15dec632 to your computer and use it in GitHub Desktop.
try
{
await client.SendAsync(token);
}
catch (OperationCanceledException ex) when (ex.CancellationToken == token)
{
// detect reason of Cancel by Token
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment