title: Right method to Use Polly C# Library to handle Exception
body: <p>I am trying to use Polly to handle exceptions thrown by my <code>WebRequest</code>.</p>
  
  <p>This is my implementation.</p>
  
  <pre><code>var generalExceptionPolicy=Policy.Handle&lt;Exception&gt;().WaitAndRetry(2, retryAttempt =&gt; 
                      TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),(exception,timespan)=&gt;{
  
          if(attempt++ == 2)
          {
              Toast.MakeText(Activity,"No Connection Bro",ToastLength.Short).Show();
  
  
          }
      });
     var test = await generalExceptionPolicy.ExecuteAsync(()=&gt;PostPreLogin (view.FindViewById&lt;EditText&gt; (Resource.Id.mobileTextBox).Text));
  </code></pre>
  
  <p>I have got the retries working. But what I am wondering is where will I get a callback after the last attempt ? I am getting a callback in Policy definition part, where I am trying to display a <code>Toast</code>message. But that is only between the trials. I am not getting it after my last trial.</p>
  
  <p>Also, my UI freezes after the last trial. Maybe becuase <code>ExecuteAsync</code> <code>Task</code> did not complete, due to the <code>Exception</code>. If that is so, what is the right approach to use Polly library ? </p>
  
  <p>This is the method that I am trying to handle with Polly</p>
  
  <pre><code>public  async Task&lt;string&gt; PostPreLogin(string userName)
      {
          var preloginvalue = await Account.PreLoginPost (userName);
          return preloginvalue;
  
      }
  </code></pre>