function xmlrpc_error in xmlrpc 8
Generates, temporarily saves, and returns an XML-RPC error object.
Parameters
string|null $code: (optional) The error code.
string|null $message: (optional) The error message.
bool $reset: (optional) 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.
10 calls to xmlrpc_error()
- xmlrpc_clear_error in ./
xmlrpc.inc - Clears any previously-saved errors.
- xmlrpc_errno in ./
xmlrpc.inc - Returns the last XML-RPC client error number.
- xmlrpc_error_msg in ./
xmlrpc.inc - Returns the last XML-RPC client error message.
- xmlrpc_server_call in ./
xmlrpc.server.inc - Dispatches an XML-RPC request and any parameters to the appropriate handler.
- xmlrpc_server_error in ./
xmlrpc.server.inc - Throws an XML-RPC error.
File
- ./
xmlrpc.inc, line 434 - 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;
}