예제 #1
0
    def on_exception(self, state: RunnerState):
        exception = state.exception
        if not utils.is_exception(exception):
            return

        if state.need_reraise_exception:
            raise exception
예제 #2
0
    def on_exception(self, state: RunnerState):
        exception = state.exception
        if not utils.is_exception(exception):
            return

        if isinstance(exception, KeyboardInterrupt):
            self.tqdm.write("Early exiting")
            state.need_reraise_exception = False
예제 #3
0
파일: logging.py 프로젝트: smivv/catalyst
    def on_exception(self, state: RunnerState):
        """Notify about raised Exception"""
        if self.log_on_exception:
            exception = state.exception
            if utils.is_exception(exception) and not isinstance(
                    exception, KeyboardInterrupt):
                text = (f"`{type(exception).__name__}` exception was raised:\n"
                        f"{exception}")

                self._send_text(text)