comparison roundup/cgi/exceptions.py @ 5264:32f95ec6bd8e

Python 2 and 3 support. Convert Exception into BaseException in core code.
author John Rouillard <rouilj@ieee.org>
date Mon, 04 Sep 2017 21:56:49 -0400
parents 65fef7858606
children 07abc8d36940
comparison
equal deleted inserted replaced
5263:f015df5f8edf 5264:32f95ec6bd8e
4 __docformat__ = 'restructuredtext' 4 __docformat__ = 'restructuredtext'
5 5
6 from roundup.exceptions import LoginError, Unauthorised 6 from roundup.exceptions import LoginError, Unauthorised
7 import cgi 7 import cgi
8 8
9 class HTTPException(Exception): 9 class HTTPException(BaseException):
10 pass 10 pass
11 11
12 class Redirect(HTTPException): 12 class Redirect(HTTPException):
13 pass 13 pass
14 14
16 pass 16 pass
17 17
18 class NotModified(HTTPException): 18 class NotModified(HTTPException):
19 pass 19 pass
20 20
21 class DetectorError(Exception): 21 class DetectorError(BaseException):
22 """Raised when a detector throws an exception. 22 """Raised when a detector throws an exception.
23 Contains details of the exception.""" 23 Contains details of the exception."""
24 def __init__(self, subject, html, txt): 24 def __init__(self, subject, html, txt):
25 self.subject = subject 25 self.subject = subject
26 self.html = html 26 self.html = html
36 user. 36 user.
37 37
38 """ 38 """
39 pass 39 pass
40 40
41 class SendFile(Exception): 41 class SendFile(BaseException):
42 """Send a file from the database.""" 42 """Send a file from the database."""
43 43
44 class SendStaticFile(Exception): 44 class SendStaticFile(BaseException):
45 """Send a static file from the instance html directory.""" 45 """Send a static file from the instance html directory."""
46 46
47 class SeriousError(Exception): 47 class SeriousError(BaseException):
48 """Raised when we can't reasonably display an error message on a 48 """Raised when we can't reasonably display an error message on a
49 templated page. 49 templated page.
50 50
51 The exception value will be displayed in the error page, HTML 51 The exception value will be displayed in the error page, HTML
52 escaped. 52 escaped.

Roundup Issue Tracker: http://roundup-tracker.org/