you can do, in controller

def mycaller(f):
    try:
        return f()
    except IOError:
        redirect(URL('my_IOError_page'))

response._caller = mycaller

response._caller wraps all action calls. Give it a try and let us know
if this works.

On Jan 13, 8:23 pm, spiffytech <[email protected]> wrote:
> My web2py application is littered with calls to a library that loves
> throwing exceptions when the website it connects to isn't available.
> I'd like my web2py app to catch the exceptions thrown by the library
> and redirect the user to a friendly error page. However, there are too
> many library calls to load up the app with try/except statements all
> over the place.
>
> Is there something I can put in my models file that will catch all
> exceptions of a certain type and handle them?

Reply via email to