Changeset 624
- Timestamp:
- 09/11/05 01:05:56
- Files:
-
- trunk/cherrypy/_cphttptools.py (modified) (1 diff)
- trunk/cherrypy/test/test_core.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cphttptools.py
r623 r624 428 428 429 429 applyFilters('afterErrorResponse') 430 return 431 except cherrypy.HTTPRedirect, inst: 432 try: 433 inst.set_response() 434 finalize() 435 return 436 except: 437 # Fall through to the second error handler 438 pass 430 439 except: 431 # Failure in _cpOnError, error filter, or finalize. 432 # Bypass them all. 433 defaultOn = (cherrypy.config.get('server.environment') == 'development') 434 if cherrypy.config.get('server.showTracebacks', defaultOn): 435 body = dbltrace % (_cputil.formatExc(exc), _cputil.formatExc()) 436 else: 437 body = "" 438 response = cherrypy.response 439 response.status, response.headers, response.body = bareError(body) 440 440 # Fall through to the second error handler 441 pass 442 443 # Failure in _cpOnError, error filter, or finalize. 444 # Bypass them all. 445 defaultOn = (cherrypy.config.get('server.environment') == 'development') 446 if cherrypy.config.get('server.showTracebacks', defaultOn): 447 body = dbltrace % (_cputil.formatExc(exc), _cputil.formatExc()) 448 else: 449 body = "" 450 response = cherrypy.response 451 response.status, response.headers, response.body = bareError(body) 441 452 442 453 def bareError(extrabody=None): trunk/cherrypy/test/test_core.py
r619 r624 100 100 101 101 class Redirect(Test): 102 103 def _cpOnError(self): 104 raise cherrypy.HTTPRedirect("/errpage") 105 106 def error(self): 107 raise NameError() 102 108 103 109 def index(self): … … 462 468 self.assertBody('0 images for fish') 463 469 self.assertStatus('200 OK') 470 471 # HTTPRedirect on error 472 self.getPage("/redirect/error") 473 self.assertStatus('303 See Other') 474 self.assertInBody('/errpage') 464 475 465 476 def testFlatten(self):

