[Mongrel] Passing XMLRPC errors on to clients

Zed A. Shaw zedshaw at zedshaw.com
Sun Feb 18 21:46:14 EST 2007


On Sun, 18 Feb 2007 14:46:36 -0600
Luke Kanies <luke at madstop.com> wrote:

> Hi,
> 
> 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.

The contract a handler has with Mongrel is the handler must handle
*all* exceptions.  If any are leaked to Mongrel it's bad news and the
connection is closed.  Period.

If you look at your webrick code you've got several places where you
catch the exceptions you want, but none of this code in the Mongrel
version.

Since XMLRPC requires that exceptions be translated into an XML fault
format, you'll have to write that.  Mongrel can't do it.

Hope that helps.

-- 
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.zedshaw.com/
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
http://mongrel.rubyforge.org/
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.


More information about the Mongrel-users mailing list