Skip to content

Commit 841af51

Browse files
author
Richard Jones
committed
beginnings of nicer web error handling
1 parent a6fc3e8 commit 841af51

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

roundup/cgi/client.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.95 2003-02-18 10:58:32 richard Exp $
1+
# $Id: client.py,v 1.96 2003-02-20 07:13:14 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -15,20 +15,31 @@
1515

1616
from roundup.cgi.PageTemplates import PageTemplate
1717

18-
class Unauthorised(ValueError):
19-
pass
20-
21-
class NotFound(ValueError):
22-
pass
23-
24-
class Redirect(Exception):
18+
class HTTPException(Exception):
19+
pass
20+
class Unauthorised(HTTPException):
21+
pass
22+
class NotFound(HTTPException):
23+
pass
24+
class Redirect(HTTPException):
25+
pass
26+
27+
# XXX actually _use_ FormError
28+
class FormError(ValueError):
29+
''' An "expected" exception occurred during form parsing.
30+
- ie. something we know can go wrong, and don't want to alarm the
31+
user with
32+
33+
We trap this at the user interface level and feed back a nice error
34+
to the user.
35+
'''
2536
pass
2637

2738
class SendFile(Exception):
28-
' Sent a file from the database '
39+
''' Send a file from the database '''
2940

3041
class SendStaticFile(Exception):
31-
' Send a static file from the instance html directory '
42+
''' Send a static file from the instance html directory '''
3243

3344
def initialiseSecurity(security):
3445
''' Create some Permissions and Roles on the security object

0 commit comments

Comments
 (0)