You are here

function sf_queue_handle_exception in Salesforce Suite 7.2

Same name and namespace in other branches
  1. 6.2 sf_queue/sf_queue.module \sf_queue_handle_exception()

Set global state if API limit is exceeded, password is expired, creds are wrong, or if there are any other "blocker" exceptions. Otherwise, log the exception and update the queue records with failure attempts.

2 calls to sf_queue_handle_exception()
sf_queue_handle_deletes in sf_queue/sf_queue.module
Helper function to process queue deletes. Since we can delete across object types by SFID alone, plow through 200 deletes at a time, oldest first.
sf_queue_handle_upserts in sf_queue/sf_queue.module
Helper function to process queue updates and inserts (creates). The logic proceeds basically like this:

File

sf_queue/sf_queue.module, line 436
sf_queue.module Implements export queue and administrativa for Salesforce API

Code

function sf_queue_handle_exception($e, $dataset) {

  // TODO: Parse the exception and take action on it
  $oids = array();
  if (is_array($dataset)) {
    foreach ($dataset as $data) {
      $oids[] = $data['oid'];
    }
  }
  else {
    $oids[] = $dataset['oid'];
  }
  if (is_int($oid[0])) {

    // TODO Please convert this statement to the D7 database API syntax.
    db_query('UPDATE {salesforce_export_queue} SET attempts = attempts + 1 WHERE oid IN (' . db_placeholders($oids) . ')', $oids);
  }
}