@contextmanager
def exception_to_errormsg():
    try:
        yield
    except exceptions.PyUniteWarning as e:
        warn(str(e))
    except exceptions.PyUniteError as e:
        error(str(e))
    except __HOLE__ as e:
        # It's better to provide a stack trace than nothing
        if not str(e):
            raise
        warn(str(e))
dataset/ETHPy150Open azure-satellite/pyunite/pyunite/ui.py/exception_to_errormsg