The XMLRPC server included with services does not have a custom error handler, so all calls to services_error() simply return straight text messages. This makes error handling difficult on the client side. The attached patch adds xmlrpc_server_server_error($message) which returns an XMLRPC error to the client when services_error() is called and the XMLRPC server is being used. This code is stolen from blogapi, which has a similar function. It seems fine to me, but if anyone has any ideas for improvements let me know.

CommentFileSizeAuthor
xmlrpc_server_error.patch573 bytesgdd

Comments

gdd’s picture

Status: Active » Needs review

setting proper status, oops

heydere’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

I've tested this patch (by cutting and pasting the code) and it works fine for me. The faultCode and faultString values are being sent properly and I can pick them up with my client code.

I didn't change the type but this seems more like a bug report than a feature request - the services module isn't obeying the standard XMLRPC fault procedures without this patch.

I'll be very happy once this gets committed!

marcingy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to drupal 5 and drupal 6.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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