From: richard Date: Thu, 20 Feb 2003 07:13:14 +0000 (+0000) Subject: beginnings of nicer web error handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8528e55d7a0aa47d90a41ce4b028d89ed6a5537c;p=roundup.git beginnings of nicer web error handling git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1534 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 4726d7b..1f23fae 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.95 2003-02-18 10:58:32 richard Exp $ +# $Id: client.py,v 1.96 2003-02-20 07:13:14 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -15,20 +15,31 @@ from roundup.cgi import cgitb from roundup.cgi.PageTemplates import PageTemplate -class Unauthorised(ValueError): - pass - -class NotFound(ValueError): - pass - -class Redirect(Exception): +class HTTPException(Exception): + pass +class Unauthorised(HTTPException): + pass +class NotFound(HTTPException): + pass +class Redirect(HTTPException): + pass + +# XXX actually _use_ FormError +class FormError(ValueError): + ''' An "expected" exception occurred during form parsing. + - ie. something we know can go wrong, and don't want to alarm the + user with + + We trap this at the user interface level and feed back a nice error + to the user. + ''' pass class SendFile(Exception): - ' Sent a file from the database ' + ''' Send a file from the database ''' class SendStaticFile(Exception): - ' Send a static file from the instance html directory ' + ''' Send a static file from the instance html directory ''' def initialiseSecurity(security): ''' Create some Permissions and Roles on the security object