Re: Help catching an exception...

Andrew McNamara <[email protected]> Thu, 30 Sep 2004 10:59:19 +1000
Newsgroups gmane.comp.web.albatross.general
Message-ID <[email protected]>
>In the testing process, I have determined that certain type of request urls
>will cause Albatross to throw an exception, and I'm trying to catch that
>exception to redirect to a public error page of my choosing so that end
>users do not see the Python tracebacks.

There are several ways to do this. As Neal suggested, you can subclass
the Application class you have chosen, and override the handle_exception
method, or you can add a template page called "traceback.html", which
will be passed the python and albatross template tracebacks (with special
characters suitably escaped) in python_exc and html_exc respectively.

I would also recommend looking at the Albatross code - specifically the
Application class in app.py.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/