Use xmlrpc_error() to return errors

Created on 19 July 2024, about 2 months ago
Updated 2 August 2024, about 2 months ago

A XML-RPC callback needs to use xmlrpc_error() to return errors.

This is what the XML-RPC callbacks defined from Drupal core do. See xmlrpc_server_method_signature(), for example.

$xmlrpc_server = xmlrpc_server_get();
if (!isset($xmlrpc_server->callbacks[$methodname])) {
    return xmlrpc_error(-32601, t('Server error. Requested method @methodname not specified.', array(
        "@methodname" => $methodname,
    )));
}

When there are no errors, the XML-RPC callback can just return TRUE.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024