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

Changeset 406

Show
Ignore:
Timestamp:
07/05/05 15:30:24
Author:
fumanchu
Message:

Even more better error-handling in _cpwsgi.

Files:

Legend:

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

    r405 r406  
    9595                                environ['wsgi.url_scheme'], 
    9696                                ) 
    97         start_response(cherrypy.response.status, cherrypy.response.headers) 
    9897    except: 
    9998        tb = _cputil.formatExc() 
    10099        cherrypy.log(tb) 
    101100        s, h, b = _cphttptools.bareError(tb) 
    102         start_response(s, h, sys.exc_info()) 
     101        exc = sys.exc_info() 
     102    else: 
     103        resp = cherrypy.response 
     104        s, h, b = resp.status, resp.headers, resp.body 
     105        exc = None 
    103106     
    104107    try: 
    105         for chunk in cherrypy.response.body: 
     108        start_response(s, h, exc) 
     109        for chunk in b: 
    106110            # WSGI requires all data to be of type "str". This coercion should 
    107111            # not take any time at all if chunk is already of type "str". 

Hosted by WebFaction

Log in as guest/cpguest to create tickets