title: Exception User-Unhandled reported in VS Debugger when using Polly
body: <p>I'm using Polly to catch an exception while calling a Pittney Bowes Geocoder service.  I'm using a g1client library that throws a MessageProcessingException.  I've wrapped the call in a Polly network policy to retry the call up to 3 times if this exception is thrown, but Visual Studio insists that the exception is "User-Unhandled" What do I need to modify to make this exception be handled?
  I'm using Visual Studio 2017 community Edition and C# 4.6.1.</p>
  
  <pre><code>try
  {
      var networkPolicy = Policy
                                .Handle&lt;MessageProcessingException&gt;()
                                .Or&lt;Exception&gt;()
                                .WaitAndRetry(
                                     3,
                                     retryAttempt =&gt; TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
                                     (exception, timeSpan, context) =&gt;
                                     {
                                         System.Diagnostics.Debug.WriteLine("Exception being retried" + exception);
                                     });
      geocoderResponse = networkPolicy.Execute(() =&gt; geocoderService.Process(geocoderRequest));
  }
  catch (MessageProcessingException ex)
  {
      log.Error("MessageProcessingException calling the Geocoder service", ex);
      throw ex;
  }
  catch (Exception ex)
  {
      log.Error("Exception calling the Geocoder service", ex);
      throw ex;
  }
  </code></pre>
  
  <p>The error message is:</p>
  
  <pre><code>g1client.MessageProcessingException occurred
    HResult=0x80131500
    Message=Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Client timeout
    Source=g1client
    StackTrace:
     at g1client.UTF8Serializer.DeserializeHashtable(NetworkStream networkStream)
     at g1client.UTF8Serializer.GetMessage(NetworkStream networkStream)
     at g1client.SocketGatewayConnection.ProcessBytes(Byte[] bytesIn)
     at g1client.SocketGatewayConnection.Process(Message message)
     at g1client.RemoteService.Process(Message message)
     at Midas.Core.PBGeocoder.Geocoder.&lt;&gt;c__DisplayClass27_0.&lt;Bulk2PassGeocode&gt;b__2() in E:\Source Code\GitHub\Midas.Core\Midas.Core.PBGeocoder\Geocoder.cs:line 321
     at Polly.Policy.&lt;&gt;c__DisplayClass75_0`1.&lt;Execute&gt;b__0(CancellationToken ct)
     at Polly.Policy.&lt;&gt;c__DisplayClass27_0`1.&lt;Execute&gt;b__0(CancellationToken ct)
     at Polly.RetrySyntax.&lt;&gt;c__DisplayClass11_0.&lt;WaitAndRetry&gt;b__1(CancellationToken ct)
     at Polly.Retry.RetryEngine.Implementation[TResult](Func`2 action, CancellationToken cancellationToken, IEnumerable`1 shouldRetryExceptionPredicates, IEnumerable`1 shouldRetryResultPredicates, Func`1 policyStateFactory)
  </code></pre>
  
  <p>I'd like to also track down why I'm getting this error, so any help debugging that would be great also.  I only get it the first time I call the service with a large request.  In this case I was sending 1000 addresses to be processed.  The next run the request will be handled in under a second, but the first time it doesn't work.</p>