Пример #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
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])