# HG changeset patch # User paulb # Date 1168468047 0 # Node ID 9b47d24643ff37e14f3c6829547ab1907168b73e # Parent eda4e3bd1172f92aff67f6ce8946f47c1a0ad123 [project @ 2007-01-10 22:27:27 by paulb] Added missing Error module. diff -r eda4e3bd1172 -r 9b47d24643ff WebStack/Adapters/Helpers/Error.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebStack/Adapters/Helpers/Error.py Wed Jan 10 22:27:27 2007 +0000 @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +""" +Standard error message output. + +Copyright (C) 2006 Paul Boddie + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +""" + +from WebStack.Generic import ContentType + +class ErrorResource: + + "An error resource which should not itself cause error conditions." + + def respond(self, trans): + trans.set_content_type(ContentType("text/html")) + out = trans.get_response_stream() + out.write(""" + + Error + + +

Error

+

An error has occurred preventing the application from returning a response.

+ + +""") + +# vim: tabstop=4 expandtab shiftwidth=4