[albatross-users] Help catching an exception...

Andrew McNamara andrewm at object-craft.com.au
Thu Sep 30 10:59:19 EST 2004


>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/



More information about the Albatross-users mailing list