The following patch resets the xmlrpc error code every time a xmlrpc request is issued.

CommentFileSizeAuthor
xmlrpc_11.patch993 bytesleoburd

Comments

Steven’s picture

Is this necessary? It seems to me you can tell whether the request succeeded by checking if the return value of xmlrpc() !== FALSE. Only then do you need to call xmlrpc_errno() and friends to find out more.

chx’s picture

Status: Needs review » Closed (won't fix)

Indeed. As the docs say, for a simple call, check the return value of xmlrpc first and only on error turn to xmlrpc_error. On system.multicall you do not even need to call xmlrpc_error as the error objects are among the results (check the result for being an object and ->is_error TRUE).

leoburd’s picture

Hello there,

Is xmlrpc_error() was a function private to xmlrpc.inc? If so, what you are saying makes sense. However, blogapi.module uses xmlrpc_error() to setup it's own error messages and that's not captured by testing xmlrpc() !== FALSE ...

In my case, I assumed that blogapi.module was correct and implemented a similar solution in my modules. Shall I get rid of xmlrpc_error() calls in my modules?

Thanks for your time,

.L.

wyssp’s picture

Version: 4.7.0-beta6 » 5.x-dev

What happens if I expect a boolean value from my xmlrpc call? How can I distinguish between the FALSE from an error and a FALSE I got from the remote server.

Naryoril’s picture

Status: Closed (won't fix) » Active

i've got the same problem as wyssp

hanoii’s picture

just suggesting, if you are the one who also did the function on the server side, just let it return an int instead of a boolean so you can safely check for === false for error

Anonymous’s picture

This issue is being addressed for 6.x-dev here:

http://drupal.org/node/208270

Anonymous’s picture

Version: 5.x-dev » 6.x-dev
Status: Active » Closed (duplicate)