You are here

function services_client_error_retry in Services Client 7

Same name and namespace in other branches
  1. 7.2 services_client_error/services_client_error.module \services_client_error_retry()

Retry and execute error

Parameters

array $error: Error record from DB.

2 calls to services_client_error_retry()
services_client_error_admin_repair_synchronize in services_client_error/services_client_error.admin.inc
Try to resynchronize data.
services_client_error_task_retry_call in services_client_error/services_client_error.tasks.inc
Re-try to send data to remote connection on services client failure.

File

services_client_error/services_client_error.module, line 372
Services Client error handling, re-try and reporting.

Code

function services_client_error_retry($error) {

  // Count error retry
  $error['retries']++;
  $result = array(
    'retries' => $error['retries'],
  );
  try {
    $task = services_client_get_existing_hooks($error['task']);
    services_client_make_call($error['data'], $error['hook'], $task);
    $result['status'] = $error['status'] = SC_ERROR_COMPLETED;
  } catch (ServicesClientConnectionResponseException $e) {
    $e
      ->log();
    $result['error_code'] = $e
      ->getErrorCode();
    $result['error_message'] = $e
      ->getErrorMessage();
  }
  drupal_write_record('services_client_error', $error, array(
    'eid',
  ));
  return $result;
}