def run_hooks(cls, hooks):
        """Execute the indicated hooks, trapping errors.

        Hooks with ``.failsafe == True`` are guaranteed to run
        even if others at the same hookpoint fail. In this case,
        log the failure and proceed on to the next hook. The only
        way to stop all processing from one of these hooks is
        to raise a BaseException like SystemExit or
        KeyboardInterrupt and stop the whole server.
        """
        assert isinstance(hooks, collections.abc.Iterator)
        quiet_errors = (
            cherrypy.HTTPError,
            cherrypy.HTTPRedirect,
            cherrypy.InternalRedirect,
        )
        safe = filter(operator.attrgetter('failsafe'), hooks)
        for hook in hooks:
            try:
                hook()
            except quiet_errors:
                cls.run_hooks(safe)
                raise
            except Exception:
                cherrypy.log(traceback=True, severity=40)
                cls.run_hooks(safe)
                raise
Execute the indicated hooks, trapping errors.

        Hooks with ``.failsafe == True`` are guaranteed to run
        even if others at the same hookpoint fail. In this case,
        log the failure and proceed on to the next hook. The only
        way to stop all processing from one of these hooks is
        to raise a BaseException like SystemExit or
        KeyboardInterrupt and stop the whole server.
        
cherrypy/_cprequest.py