[Zope] exception handling for zclient

wade naveja wade@fizzylab.com
Tue, 16 Jan 2001 12:49:09 -0800 (PST)


i'm using zclient as outlined in
http://www.zope.org/Members/lstaffor/ZClientMethod to serve pages from
another web server as if they were being served form my zope server.

how would i write an exception to handle the case of the other web server
being down?  when the other web server is down, i'd like to include a bit
of text saying "this service is temporarily unavailable.  blah, blah,
blah...".


from ZPublisher import Client

def web_client(url = 'http://www.server.com/', username = None,
password = None, **kw):
        '''access http server'''
        if kw:
                return Client.call(url,username,password,kw)[1]
        else:
                return Client.call(url,username,password)[1]