[albatross-users] Defining an "error" page...

Andrew McNamara andrewm at object-craft.com.au
Wed Sep 18 10:31:29 EST 2002


>In JavaServer Pages (JSP), you have the ability to specify a page to
>which the user is forwarded if there is an unrecoverable error.  This is
>commonly used to send the user to a page that says "There has been an
>error.  Please call the site administrator." rather than expose the user
>to the raw Python error displays, such as:
[...]
>Is there any way to achieve the same functionality in Albatross?

Yes - the handle_exception() method on the Application mixin attempts to
run the template "traceback.html", and only if that fails (doesn't exist,
or produces an exception) does it display the traceback to the user.

The python and template tracebacks are available to the template in
python_exc and html_exc respectively.

Alternatively, if you want to do something this framework doesn't allow,
you can define you own handle_exception() method on your application
class.

Albatross tries to make it's source accessible for extension - have a look
at the Application class in app.py to see how this machinery works.

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



More information about the Albatross-users mailing list