import os import sys def exception_handler(exception_type, exception, traceback): if bool(os.getenv('DEBUG_UCLOUD')) is True: sys.__excepthook__(exception_type, exception, traceback) else: print("%s: %s" % (exception_type.__name__, exception))