import click


def editor(*args, **kwargs):
    """
    Wrapper for `click.edit` that raises an error when None is returned.
    """
    result = click.edit(*args, **kwargs)
    if result is None:
        msg = "Editor exited without saving, command aborted"
        raise click.ClickException(msg)
    return result