def METHOD_NAME(self, exctype, value, tb):
    if exctype is KeyboardInterrupt or exctype is SystemExit:
        sys.__excepthook__(exctype, value, tb)
    else:
        # Ensure that the exception is logged at the point of occurrence.
        logger.exception("logged exception, thread=%s", threading.get_ident(),
            exc_info=(exctype, value, tb))
        self.uncaught_signal.emit((exctype, value, tb))