Example #1
0
 private void LogSendError(HttpRequestMessage request, CancellationTokenSource cancellationTokenSource,
                           string method, Exception e)
 {
     Debug.Assert(request != null);
     if (NetEventSource.IsEnabled)
     {
         if (cancellationTokenSource.IsCancellationRequested)
         {
             if (NetEventSource.IsEnabled)
             {
                 NetEventSource.Error(this, $"Method={method} Error{SR.Format(SR.net_http_client_send_canceled, NetEventSource.GetHashCode(request))}");
             }
         }
         else
         {
             Debug.Assert(e != null);
             if (NetEventSource.IsEnabled)
             {
                 NetEventSource.Error(this, $"Method={method} Error{SR.Format(SR.net_http_client_send_error, NetEventSource.GetHashCode(request), e)}");
             }
         }
     }
 }