from typing import Union


def get_image_tag(repo: str, failed_job_id: Union[str, int]) -> str:
    """
    Construct the unique image tag identifying the pair with the given repository slug and failed job ID.

    :param repo: A repository slug.
    :param failed_job_id: A failed job ID for the pair for which the image tag will represent.
    :return: An image tag.
    """
    if not isinstance(repo, str):
        raise TypeError
    if not (isinstance(failed_job_id, str) or isinstance(failed_job_id, int)):
        raise TypeError
    if repo.count('/') != 1:
        raise ValueError('The repository slug should contain exactly one slash.')
    return '{}-{}'.format(repo.replace('/', '-'), failed_job_id)