You are here

function acquia_agent_connection_error_message in Acquia Connector 6.2

Same name and namespace in other branches
  1. 6 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()
  2. 7.3 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()
  3. 7 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()
  4. 7.2 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()

Returns an error message for the most recent (failed) attempt to connect to Acquia during the current page request. If there were no failed attempts, returns FALSE.

This function assumes that the most recent XML-RPC error came from the Acquia; otherwise, it will not work correctly.

2 calls to acquia_agent_connection_error_message()
acquia_agent_migrate_page in acquia_agent/acquia_agent.pages.inc
Migrate site to Acquia Cloud
acquia_agent_settings_form in acquia_agent/acquia_agent.pages.inc
Settings form builder function.

File

acquia_agent/acquia_agent.module, line 600
Acquia Agent securely sends information to Acquia.

Code

function acquia_agent_connection_error_message() {
  $errno = xmlrpc_errno();
  if ($errno) {
    switch ($errno) {
      case SUBSCRIPTION_NOT_FOUND:
        return t('The identifier you have provided does not exist in the Acquia Subscription or is expired. Please make sure you have used the correct value and try again.');
        break;
      case SUBSCRIPTION_EXPIRED:
        return t('Your Acquia subscription has expired. Please renew your subscription so that you can resume using Acquia subscription services.');
        break;
      case SUBSCRIPTION_MESSAGE_FUTURE:
        return t('Your server is unable to communicate with Acquia Insight due to a problem with your clock settings. For security reasons, we reject messages that are more than @time ahead of the actual time recorded by our servers. Please fix the clock on your server and try again.', array(
          '@time' => format_interval(SUBSCRIPTION_MESSAGE_LIFETIME),
        ));
        break;
      case SUBSCRIPTION_MESSAGE_EXPIRED:
        return t('Your server is unable to communicate with Acquia Insight due to a problem with your clock settings. For security reasons, we reject messages that are more than @time older than the actual time recorded by our servers. Please fix the clock on your server and try again.', array(
          '@time' => format_interval(SUBSCRIPTION_MESSAGE_LIFETIME),
        ));
        break;
      case SUBSCRIPTION_VALIDATION_ERROR:
        return t('The identifier and key you have provided for the Acquia Subscription do not match. Please make sure you have used the correct values and try again.');
        break;
      default:
        return t('There is an error communicating with Acquia Insight at this time. Please check your identifier and key and try again.');
        break;
    }
  }
  return FALSE;
}