You are here

class ServicesArgumentException in Services 6.3

Same name and namespace in other branches
  1. 7.3 includes/services.runtime.inc \ServicesArgumentException

A exception thrown by services and related modules when an error related to a specific argument is encountered.

Hierarchy

Expanded class hierarchy of ServicesArgumentException

File

./services.runtime.inc, line 48
Contains functions that only are necessary when a service call is made. This has broken out so that this code isn't loaded for every page load.

View source
class ServicesArgumentException extends ServicesException {
  private $argument;

  /**
   * Constructor for the ServicesException.
   *
   * @param string $message
   *  Error message.
   * @param string $argument_name
   *  The name of the argument that caused the error.
   * @param int $code
   *  Optional. Error code. This often maps to the HTTP status codes. Defaults
   *  to 0.
   * @param mixed $data
   *  Information that can be used by the server to return information about
   *  the error.
   */
  public function __construct($message, $argument_name, $code, $data) {
    parent::__construct($message, $code, $data);
    $this->argument = $argument_name;
  }

  /**
   * Returns the name of the argument that caused the error.
   *
   * @return string
   *  The name of the argument.
   */
  public function getArgumentName() {
    return $this->argument;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ServicesArgumentException::$argument private property
ServicesArgumentException::getArgumentName public function Returns the name of the argument that caused the error.
ServicesArgumentException::__construct public function Constructor for the ServicesException. Overrides ServicesException::__construct
ServicesException::$data private property
ServicesException::getData public function Returns the data associated with the exception.