There seems to be a (surprising) inconsistency between the parameters for the function services_error and the various hook_server_error implementations, particularly xmlrpc_server_server_error.

If the services_error function is defined as (services.module, line 240, CVS Tag DRUPAL-6--2-2):
function services_error($message, $code = 0, $exception = NULL)
and also calls the various hooks with all three parameters, I do not understand why the xmlrpc_server implementation ignores the $code value in its definition (xmlrpc_server.module, line 62, CVS Tag DRUPAL-6--2-2):
function xmlrpc_server_server_error($message)
when it could easily accept a $code value which would be returned as the faultCode in the XMLRPC specifications.

This function seems to attempt to extract the error code from the message, however most of the services functions supply the error code (usually a HTTP error code) as the second parameter, with the result that using the XML-RPC server these are lost, and a generic error code of 1 (one) is returned.

The REST server accepts all three parameters, whereas the JSON Server only accepts the $message parameter.

As far as the XMLRPC server is concerned, I have made a patch which adds the second parameter, while hopefully maintaining the original functionality.

Best regards,

John

CommentFileSizeAuthor
error-code.patch1.55 KBjhl.verona

Comments

kylebrowning’s picture

Status: Needs review » Fixed

Tested, and committed.

Status: Fixed » Closed (fixed)
Issue tags: -servers, -xmlrpc_server

Automatically closed -- issue fixed for 2 weeks with no activity.