'Modify cherrypy.response status, headers, and body to represent
self.
CherryPy uses this internally, but you can also use it to create an
HTTPError object and set its output without *raising* the exception.'

def set_response(self):

    import cherrypy
    response = cherrypy.serving.response
    clean_headers(self.code)
    response.status = self.status
    tb = None
    if cherrypy.serving.request.show_tracebacks:
        tb = format_exc()
    response.headers.pop('Content-Length', None)
    content = self.get_error_page(self.status, traceback=tb, message=self._message)
    response.body = content
    _be_ie_unfriendly(self.code)
