예제 #1
0
 def finalize(self):
     """Transform headers (and cookies) into cherrypy.response.header_list."""
     
     try:
         code, reason, _ = httptools.validStatus(self.status)
     except ValueError, x:
         raise cherrypy.HTTPError(500, x.args[0])
예제 #2
0
파일: _cputil.py 프로젝트: thraxil/gtreed
def getErrorPage(status, **kwargs):
    """Return an HTML page, containing a pretty error response.
    
    status should be an int or a str.
    kwargs will be interpolated into the page template.
    """
    
    try:
        code, reason, message = httptools.validStatus(status)
    except ValueError, x:
        raise cherrypy.HTTPError(500, x.args[0])