I just did, but then I looked and Michael Casaday submitted an
apparently identical patch in June of last year.  So take your pick.

> I agree, it would be nice to allow a method to raise a Fault and have it
> pass through.  Can you upload this as a patch to SourceForge?
> 
> - Geoff
> 
> [EMAIL PROTECTED] wrote:
> > Hello.  Currently, XMLRPCServlet catches any exception in a service
> > method and wraps it in a Fault object with faultCode forced to 1.
> > This seems... wrong.  The whole point of having fault codes is that
> > you can flag error conditions to the caller in an easy-to-parse way.
> > I suggest something like the following be applied to XMLRPCServlet.py;
> > it allows your service method to raise a Fault directly, in which case
> > it's marshalled back unmolested.
> > 
> > [diff begins]
> > diff -d -c -r1.3 XMLRPCServlet.py
> > *** XMLRPCServlet.py    3 Mar 2003 03:27:53 -0000       1.3
> > --- XMLRPCServlet.py    11 Jan 2004 02:24:19 -0000
> > ***************
> > *** 44,49 ****
> > --- 44,53 ----
> >                                         response =
> > self.call(method, *params)
> >                                 if type(response) != type(()):
> >                                         response = (response,)
> > +                       except xmlrpclib.Fault, fault:
> > +                               response =
> > xmlrpclib.dumps(fault, encoding=encoding)
> > +                               self.sendOK('text/xml',
> > response, transaction)
> > +                               self.handleException(transaction)
> >                         except Exception, e:
> >                                 fault =
> > self.resultForException(e, transaction)
> >                                 response =
> > xmlrpclib.dumps(xmlrpclib.Fault(1, fault), encoding=encoding) [diff
> > ends] ~
> > 
> > 
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Perforce Software.
> > Perforce is the Fast Software Configuration Management System offering
> > advanced branching capabilities and atomic changes on 50+ platforms.
> > Free Eval! http://www.perforce.com/perforce/loadprog.html
> > _______________________________________________
> > Webware-discuss mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/webware-discuss
> 


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to