You are here

private function Salesforce::checkResponseDataForApiError in Salesforce Suite 7.3

Private helper that throws an exception if a API error is found in the response data.

Parameters

array $data: Array of salesforce api response data.

Throws

SalesforceException

2 calls to Salesforce::checkResponseDataForApiError()
Salesforce::apiCall in includes/salesforce.inc
Make a call to the Salesforce REST API.
Salesforce::refreshToken in includes/salesforce.inc
Refresh access token based on the refresh token. Updates session variable.

File

includes/salesforce.inc, line 172
Objects, properties, and methods to communicate with the Salesforce REST API

Class

Salesforce
Ability to authorize and communicate with the Salesforce REST API.

Code

private function checkResponseDataForApiError($data) {
  if (isset($data['error'])) {
    throw new SalesforceException($data['error_description'], $data['error']);
  }
  if (!empty($data['errorCode'])) {
    throw new SalesforceException($data['message'], $this->response->code);
  }
}