class ServicesException in Services 7.3
Same name and namespace in other branches
- 6.3 services.runtime.inc \ServicesException
A exception thrown by services and related modules when something goes wrong.
Hierarchy
- class \ServicesException extends \Exception
Expanded class hierarchy of ServicesException
File
- includes/
services.runtime.inc, line 13 - 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 ServicesException extends Exception {
private $data;
/**
* Constructor for the ServicesException.
*
* @param string $message
* Error message.
* @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, $code = 0, $data = NULL) {
parent::__construct($message, $code);
$this->data = !empty($data) ? $data : $message;
}
/**
* Returns the data associated with the exception.
*
* @return mixed
*/
public function getData() {
return $this->data;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServicesException:: |
private | property | ||
ServicesException:: |
public | function | Returns the data associated with the exception. | |
ServicesException:: |
public | function | Constructor for the ServicesException. | 1 |