'Handle the last unanticipated exception. (Core)'

def handle_error(self):

    try:
        self.hooks.run('before_error_response')
        if self.error_response:
            self.error_response()
        self.hooks.run('after_error_response')
        cherrypy.serving.response.finalize()
    except cherrypy.HTTPRedirect:
        inst = sys.exc_info()[1]
        inst.set_response()
        cherrypy.serving.response.finalize()
