Changeset 1334
- Timestamp:
- 09/04/06 16:12:38
- Files:
-
- trunk/cherrypy/__init__.py (modified) (1 diff)
- trunk/cherrypy/_cperror.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1332 r1334 6 6 _localdir = _os.path.dirname(__file__) 7 7 8 from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect, NotFound 8 from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect, NotFound, CherryPyException 9 9 from cherrypy._cperror import TimeoutError 10 10 trunk/cherrypy/_cperror.py
r1308 r1334 7 7 8 8 import exceptions 9 class Exception(exceptions.Exception):9 class CherryPyException(exceptions.Exception): 10 10 pass 11 11 12 class InternalRedirect( Exception):12 class InternalRedirect(CherryPyException): 13 13 """Exception raised when processing should be handled by a different path. 14 14 … … 38 38 self.path = path 39 39 40 Exception.__init__(self, path)41 42 43 44 class HTTPRedirect( Exception):40 CherryPyException.__init__(self, path) 41 42 43 44 class HTTPRedirect(CherryPyException): 45 45 """Exception raised when the request should be redirected. 46 46 … … 82 82 83 83 self.status = status 84 Exception.__init__(self, abs_urls, status)84 CherryPyException.__init__(self, abs_urls, status) 85 85 86 86 def set_response(self): … … 139 139 140 140 141 class HTTPError( Exception):141 class HTTPError(CherryPyException): 142 142 """ Exception used to return an HTTP error code (4xx-5xx) to the client. 143 143 This exception will automatically set the response status and body. … … 152 152 raise ValueError("status must be between 400 and 599.") 153 153 self.message = message 154 Exception.__init__(self, status, message)154 CherryPyException.__init__(self, status, message) 155 155 156 156 def set_response(self): … … 212 212 213 213 214 class TimeoutError( Exception):214 class TimeoutError(CherryPyException): 215 215 """Exception raised when Response.timed_out is detected.""" 216 216 pass

