title: Chaining Tasks with Faulted checks
body: <p>I'm using tasks to do a number of web service calls, and want to back out if it fails at any point. Here's my code at the moment:</p>
  
  <pre><code>service.Login(usernameTextField.Text, passwordTextField.Text).ContinueWith( t =&gt; {
      if (t.IsFaulted){
          new UIAlertView("Login Failed", "Unable to contact server at this time", null, "OK").Show();
      } else {
          if (t.Result)
          {
              service.GetImportantData ().ContinueWith (genericTask =&gt; {
                  if (genericTask.IsFaulted){
                      new UIAlertView("Login Failed", "Unable to contact server at this time", null, "OK").Show();
                  }
                  else {
                      service.SyncUserSpecificData().ContinueWith(projectTask =&gt; {
                          NavigationController.PopToRootViewController(true);
                      });
                  }
              }, TaskScheduler.FromCurrentSynchronizationContext ());
  
          } else {
              new UIAlertView("Login Failed", "Please check your login and try again", null, "OK").Show();
          }
      }
      loadingOverlay.Hide();
  
  });
  </code></pre>
  
  <p>It's a Xamarin app but that shouldn't matter as I'm just wondering is there a better way to compose them including the error checks as it's callback soup at the moment.</p>