You are here

protected function AcquiaLiftAgent::convertAgentExceptionToErrors in Acquia Lift Connector 7

Converts an exception thrown by the API class into errors added to the passed in array.

Parameters

AcquiaLiftException $e: The excetion that was thrown.

$errors: An array of errors to add to.

Return value

array The new errors array.

1 call to AcquiaLiftAgent::convertAgentExceptionToErrors()
AcquiaLiftAgent::errors in plugins/agent_types/AcquiaLiftAgent.inc
Implements PersonalizeAgentInterface::errors().

File

plugins/agent_types/AcquiaLiftAgent.inc, line 838
Provides an agent type for Acquia Lift

Class

AcquiaLiftAgent

Code

protected function convertAgentExceptionToErrors(AcquiaLiftException $e, &$errors) {
  if ($e instanceof AcquiaLiftNotFoundException) {
    $errors[] = t('This agent has not yet been pushed to Acquia Lift');
  }
  else {
    $errors[] = t('There was a problem communicating with the Acquia Lift server.');
  }
  return $errors;
}