With having localization in mind, kind of annoying to only get a message returned for say user.login ("The user has already logged in.")

much nicer for error control to just have to do if ($result['code'] == USER_LOGIN_ERROR) .

CommentFileSizeAuthor
#3 services_errnum.patch828 bytesscottgifford

Comments

sitron2’s picture

+1
thanks!

marcingy’s picture

Status: Active » Postponed

Happy to do this but please provide a patch

scottgifford’s picture

Status: Postponed » Needs review
StatusFileSize
new828 bytes

Here is a patch against 5.x-0.92 which has the XML-RPC error handler look in the message for a pound sign followed by numbers, and if it finds it reports that as an error code. A bit of a hack, but it avoids changing the API that other RPC servers use, and doesn't conflict with RPC types that don't support a numeric error code (like JSON IIRC).

marcingy’s picture

That is fine keeping it specific to the xml-rpc server. Looks good from a quick eyeball - will test over the weekend and commit if no issues occur.

marcingy’s picture

Status: Needs review » Fixed

Commited against d5 and d6

Anonymous’s picture

lol wow. i didnt know this got committed. thanks guys :)

marcingy’s picture

Status: Fixed » Closed (fixed)