title: How can we handle it when a block in GCD fails to execute?
body: <p>I am very new to the GCD approach. I am trying to sync data from the Internet using blocks in GCD. I have a situation where if the sync operation is in progress, and the network fails then my application crashes. When not using blocks, I am able to handle that by using the @try/@catch method. But when I am trying to do it with blocks and GCD, I am not able to handle the crash or the exception. Any ideas on how to handle the crash?</p>
  
  <p>Calling sync accounts in the block: </p>
  
  <pre><code>dispatch_async(exampleQueue, ^{
      dispatch_async(dispatch_get_main_queue(), ^{
          [self sendSyncStatusUpdate:@"Loading Accounts"];
      });
  
      [AccountService syncAccounts];
      [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:@"accountsFirstSyncCompleted"];
  
      dispatch_async(dispatch_get_main_queue(), ^{
          [self.tableView reloadData];
      });
  });
  </code></pre>
  
  <p>-[AccountService syncAccounts] method: </p>
  
  <pre><code>@try {
      ZKDescribeSObject *accountDescription = [app.client describeSObject:@"Account"];
      NSString *query = [NSString stringWithFormat:@"Select %@ From Account Where LastModifiedDate &gt; %@", [accountDescription fieldsAsCsv], [dateTimeFormatter stringFromDate:lastSyncDate]];
  
      ZKQueryResult *result = [[app.client query:query batchSize:[NSNumber numberWithInt:200]] retain];
  }
  @catch (ZKSoapException *e) {
      [RootViewController hadSyncError:e];
  }
  </code></pre>
  
  <p>I am not able to catch the exception that occurs when we go offline while syncing.</p>