def on_exception(self, runner: "IRunner"):
        """Called if an Exception was raised."""
        if runner.engine.process_index > 0:
            return
        ex = runner.exception
        if not ((ex is not None) and isinstance(ex, BaseException)):
            return

        if isinstance(ex, KeyboardInterrupt):
            if self.tqdm is not None:
                self.tqdm.write("Keyboard Interrupt")
                self.tqdm.clear()
                self.tqdm.close()
                self.tqdm = None
Called if an Exception was raised.
catalyst/callbacks/misc.py