Esempio n. 1
0
 async Task TryCompleteCommandAsync(Command command, string error)
 {
     try
     {
         await Webservice.CompleteCommandAsync(command.ID, error, cts.Token).ConfigureAwait(false);
     }
     catch (OperationCanceledException) when(cts.IsCancellationRequested)
     {
         // As expected
     }
     catch (Exception exception)
     {
         Program.Trace($"Failed to complete command: { exception.Message }");
     }
 }