function xmlrpc_error in Drupal 7
Same name and namespace in other branches
- 4 includes/xmlrpc.inc \xmlrpc_error()
- 5 includes/xmlrpc.inc \xmlrpc_error()
- 6 includes/xmlrpc.inc \xmlrpc_error()
Generates, temporarily saves, and returns an XML-RPC error object.
Parameters
$code: The error code.
$message: The error message.
$reset: TRUE to empty the temporary error storage. Ignored if $code is supplied.
Return value
object An XML-RPC error object representing $code and $message, or the most recently stored error object if omitted.
8 calls to xmlrpc_error()
- xmlrpc_clear_error in includes/
xmlrpc.inc - Clears any previously-saved errors.
- xmlrpc_errno in includes/
xmlrpc.inc - Returns the last XML-RPC client error number.
- xmlrpc_error_msg in includes/
xmlrpc.inc - Returns the last XML-RPC client error message.
- xmlrpc_server_call in includes/
xmlrpcs.inc - Dispatches an XML-RPC request and any parameters to the appropriate handler.
- xmlrpc_server_error in includes/
xmlrpcs.inc - Throws an XML-RPC error.
File
- includes/
xmlrpc.inc, line 438 - Drupal XML-RPC library.
Code
function xmlrpc_error($code = NULL, $message = NULL, $reset = FALSE) {
static $xmlrpc_error;
if (isset($code)) {
$xmlrpc_error = new stdClass();
$xmlrpc_error->is_error = TRUE;
$xmlrpc_error->code = $code;
$xmlrpc_error->message = $message;
}
elseif ($reset) {
$xmlrpc_error = NULL;
}
return $xmlrpc_error;
}