def _run_command(function, args, kwargs, exit_msg):
    success = False
    try:
        log.debug("Running %s command...", getattr(function, '__name__', 'a'))
        success = function(*args, **kwargs)
    except __HOLE__:
        log.debug("Command canceled")
        exit_msg = ""
    except RuntimeError as exc:
        exit_msg = str(exc) + exit_msg
    else:
        exit_msg = ""
    if success:
        log.debug("Command succeeded")
    else:
        log.debug("Command failed")
        sys.exit(exit_msg or 1)
dataset/ETHPy150Open jacebrowning/gitman/gitman/cli.py/_run_command