Changeset 1139
- Timestamp:
- 06/12/06 01:10:31
- Files:
-
- trunk/cherrypy/__init__.py (modified) (2 diffs)
- trunk/cherrypy/_cperror.py (modified) (4 diffs)
- trunk/cherrypy/_cprequest.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1135 r1139 4 4 5 5 6 from _cperror import *6 from _cperror import HTTPError, HTTPRedirect, InternalRedirect, NotFound, WrongConfigValue 7 7 import config 8 8 … … 140 140 """ 141 141 if traceback: 142 msg += format_exc() 142 import _cperror 143 msg += _cperror.format_exc() 143 144 logfunc = config.get('log_function', _log_message) 144 145 logfunc(msg, context, severity) trunk/cherrypy/_cperror.py
r1137 r1139 1 1 """Error classes for CherryPy.""" 2 2 3 # cherrypy imports this module as *, so hide nonessentials.4 3 from cgi import escape as _escape 5 4 from sys import exc_info as _exc_info … … 8 7 9 8 10 class Error(Exception): 11 pass 12 13 class WrongConfigValue(Error): 9 class WrongConfigValue(Exception): 14 10 """ Happens when a config value can't be parsed, or is otherwise illegal. """ 15 11 pass … … 127 123 128 124 129 class HTTPError(E rror):125 class HTTPError(Exception): 130 126 """ Exception used to return an HTTP error code to the client. 131 127 This exception will automatically set the response status and body. … … 140 136 raise ValueError("status must be between 400 and 599.") 141 137 self.message = message 142 E rror.__init__(self, status, message)138 Exception.__init__(self, status, message) 143 139 144 140 def set_response(self): trunk/cherrypy/_cprequest.py
r1137 r1139 8 8 import cherrypy 9 9 from cherrypy import _cpcgifs 10 from cherrypy._cperror import format_exc, bare_error 10 11 from cherrypy.lib import httptools, profiler 11 12 … … 368 369 dbltrace = ("\n===First Error===\n\n%s" 369 370 "\n\n===Second Error===\n\n%s\n\n") 370 body = dbltrace % (cherrypy.format_exc(exc), 371 cherrypy.format_exc()) 371 body = dbltrace % (format_exc(exc), format_exc()) 372 372 else: 373 373 body = "" 374 r = cherrypy.bare_error(body)374 r = bare_error(body) 375 375 response.status, response.header_list, response.body = r 376 376

