[Zope] vcXMLRPC with Zope?

Martijn Pieters mj@zope.com
Thu, 5 Dec 2002 12:51:33 -0500


On Thu, Dec 05, 2002 at 12:42:54PM -0500, Jim Washington wrote:
> Mmm.  You said "patches" ... Any hope we could see them?

You beat me to it; here are all relevant changes:

diff -u -r1.1 -r1.3
--- vcXMLRPC.js 2002/08/23 16:26:58     1.1
+++ vcXMLRPC.js 2002/08/26 20:23:18     1.3
@@ -590,8 +590,11 @@    
                        //Check for XMLRPC Errors
                        rpcErr = dom.getElementsByTagName("fault");
                        if(rpcErr.length > 0){
-                               rpcErr = this.toObject(rpcErr[0].firstChild);
-                               this.handleError(new Error(rpcErr.faultCode, rpcErr.faultString));
+                               rpcErr = this.toObject(rpcErr[0].getElementsByTagName("value")[0]);
+                               fault = new Error(rpcErr.faultCode + ': ' + rpcErr.faultString);
+                               fault.code = rpcErr.faultCode;
+                               fault.string = rpcErr.faultString;
+                               this.handleError(fault)
                                return false
                        }


The above change makes vcXMLRPC robust in the face of whitespace in the
fault XML tags and preserves the XML-RPC failt string and code as attributes
on the error object.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@zope.com
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------