You are here

class ServicesClientErrorType in Services Client 7.2

Define error types.

Hierarchy

Expanded class hierarchy of ServicesClientErrorType

File

include/plugin.inc, line 143
Base plugin definitions. All other plugins should be extended from this set of plugins.

View source
class ServicesClientErrorType {

  /**
   * Network error, like can't connect to other site.
   */
  const NETWORK = 1;
  const LOOP = 2;
  const REMOTE_LOGIC = 3;
  const REMOTE_SERVER = 4;
  const UNKNOWN = 5;

  /**
   * Get list of all error types keyed by error type contstant and value is
   * user readable name.
   *
   * @return array
   */
  public static function getTypes() {
    return array(
      self::NETWORK => 'network',
      self::LOOP => 'loop',
      self::REMOTE_LOGIC => 'remote logic',
      self::REMOTE_SERVER => 'remote server',
      self::UNKNOWN => 'unknown',
    );
  }

  /**
   * Retrieve error type user readable name.
   *
   * @param int $type
   *   Type contstant value.
   *
   * @return string
   *   Name of error
   */
  public static function getTypeName($type) {
    $types = self::getTypes();
    return isset($types[$type]) ? $types[$type] : NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ServicesClientErrorType::getTypeName public static function Retrieve error type user readable name.
ServicesClientErrorType::getTypes public static function Get list of all error types keyed by error type contstant and value is user readable name.
ServicesClientErrorType::LOOP constant
ServicesClientErrorType::NETWORK constant Network error, like can't connect to other site.
ServicesClientErrorType::REMOTE_LOGIC constant
ServicesClientErrorType::REMOTE_SERVER constant
ServicesClientErrorType::UNKNOWN constant