function services_error in Services 7.3
Same name and namespace in other branches
- 5 services.module \services_error()
- 6.3 services.runtime.inc \services_error()
- 6 services.module \services_error()
- 6.2 services.module \services_error()
- 7 services.module \services_error()
Prepare an error message for returning to the server.
Parameters
string $message: Error message.
int $code: Optional. Error code. This often maps to the HTTP status codes. Defaults to 0.
mixed $data: Optional. Information that can be used by the server to return information about the error. Defaults to null.
Return value
mixed
45 calls to services_error()
- RESTServer::getController in servers/
rest_server/ includes/ RESTServer.inc - Controller is part of the resource like
- RESTServer::getControllerArgumentsFromSources in servers/
rest_server/ includes/ RESTServer.inc - array $controller Controller definition array $sources Array of sources for arguments. Consists of following elements: 'path' - path requested 'params' - GET variables 'data' - parsed POST data 'headers' -…
- RESTServer::getResponseFormatter in servers/
rest_server/ includes/ RESTServer.inc - Response formatter is responsible for encoding the response.
- RESTServer::parseRequestBody in servers/
rest_server/ includes/ RESTServer.inc - Parse request body based on $_SERVER['CONTENT_TYPE'].s
- RESTServer::render in servers/
rest_server/ includes/ RESTServer.inc - Render results using formatter.
File
- includes/
services.runtime.inc, line 370 - 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.
Code
function services_error($message, $code = 0, $data = NULL) {
throw new ServicesException($message, $code, $data);
}