[Mongrel] Passing XMLRPC errors on to clients

Luke Kanies luke at madstop.com
Sun Feb 18 15:46:36 EST 2007


I'm experimenting with using Mongrel to serve XMLRPC, and I'm having  
trouble passing the XMLRPC errors on to the client.

In my webrick implementation, I just raise the XMLRPC error and the  
client receives it and can handle it like a normal exception.  With  
Mongrel, when I raise the error, Mongrel catches it and just closes  
the client connection, which means the client gets a very  
uninformative EOF instead of a useful error message.

Has anyone on the list found a way to effectively pass the error on  
to the client?  If not, can someone recommend a place for me to start  
looking at how to do it?

It looks like I could try overriding the 'process_client' method in  
the HttpServer class, but I'd still need to know how to convert the  
error into a valid XMLRPC error, which somehow the webrick stuff just  
does for me.  Clearly this might be a necessity, but I'm hoping I can  
leave the error handling to the libraries instead of doing it myself.

If anyone is interested in how I'm doing it right now, you can check  
the source of the mongrel class I've written[1] and the xmlrpc_server  
class[2].  I'm not going to say any of this code is "good", but I've  
seen a dearth of examples and I'm doing what I can.

Any help is muchly appreciated.

1 - https://reductivelabs.com/trac/puppet/browser/branches/ 
2 - https://reductivelabs.com/trac/puppet/browser/branches/ 

  Sometimes I think we're alone. Sometimes I think we're not. In
  either case, the thought is staggering.   --R. Buckminster Fuller
  Luke Kanies | http://reductivelabs.com | http://madstop.com

More information about the Mongrel-users mailing list