Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 607

Show
Ignore:
Timestamp:
09/04/05 17:32:16
Author:
mikerobi
Message:

merged some httperror changes that got left out of the first merge

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cphttptools.py

    r606 r607  
    418418        applyFilters('beforeErrorResponse') 
    419419         
    420         # _cpOnError will probably change cherrypy.response.body. 
    421         # It may also change the headerMap, etc. 
    422         _cputil.getSpecialAttribute('_cpOnError')() 
     420        # _cpOnError and _cpOnHTTPError will probably change cherrypy.response.body. 
     421        # They may also change the headerMap, etc. 
     422        if sys.exc_info()[0] is cherrypy._cperror.HTTPClientError: 
     423            _cputil.getSpecialAttribute('_cpOnHTTPError')() 
     424        else: 
     425            _cputil.getSpecialAttribute('_cpOnError')() 
    423426         
    424427        finalize() 
  • trunk/cherrypy/tutorial/tut10_http_errors.py

    r606 r607  
    4141        code = int(code) 
    4242        HTTPClientError = cherrypy._cperror.HTTPClientError 
    43          
    44         raise HTTPClientError(status = int(code)) 
     43        raise HTTPClientError(status = code) 
    4544    error.exposed = True 
    4645 

Hosted by WebFaction

Log in as guest/cpguest to create tickets