import click


def _click_exception_with_exit_code(name: str, message: str, exitcode: int):
    """
    create an exception
    :param name: exception name
    :param message: exception message
    :param exitcode: exitcode
    :return: new exception object
    """

    class _ClickException(click.ClickException):
        exit_code = exitcode

    return type(name, (_ClickException,), {})(message)