You are here

function services_client_error_save in Services Client 7.2

Same name and namespace in other branches
  1. 7 services_client_error/services_client_error.module \services_client_error_save()

Save information about error to data log

Parameters

$data: Error data from @services_client_data_process

1 call to services_client_error_save()
services_client_error_services_client_process_events in services_client_error/services_client_error.module
Implements hook_services_client_process_errors().

File

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

Code

function services_client_error_save(ServicesClientEventResult $result) {
  $row = array(
    'created' => time(),
    'entity_type' => $result->entity_type,
    'entity_id' => $result
      ->getEntityId(),
    'event' => $result->event->name,
    'entity' => $result->entity,
    'error_code' => $result->error_code,
    'error_message' => $result->error_message,
    'retries' => 0,
    'result' => 0,
  );
  drupal_write_record('services_client_error', $row);
  $result->eid = $row['eid'];
}