How to Catch Errors in SimpleXMLRPCServer
jeff at jmcneil.net
Fri Sep 28 02:37:22 CEST 2007
Cool.. glad it works. Just be careful not to expose methods you may not
want to; use decorators, attributes, or perhaps a custom method naming
scheme to flag methods as exposed if you do it this way.
On 9/27/07, gregpinero at gmail.com <gregpinero at gmail.com> wrote:
> On Sep 27, 5:08 pm, "Jeff McNeil" <j... at jmcneil.net> wrote:
> > Yeah, that code was out of memory and I didn't test it, my apologies.
> > Need to actually return a value from _dispatch.
> > class MyCalls(object):
> > def _dispatch(self, method, args):
> > try:
> > return getattr(self, method)(*args)
> > except:
> > handle_logging()
> > server = SimpleXMLRPCServer(("localhost", 8000))
> > server.register_instance(MyCalls())
> > server.serve_forever()
> Thanks, that works. I'm not sure why I didn't notice it wasn't
> returning anything.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list