from typing import Union


def get_non_unique_numbers(numbers: list[int]) -> Union[int, list[int]]:
    """
    Return non-unique numbers in a list of numbers.
    If only one non-unique number is found, return this number.
    if all numbers is unique, raise ValueError.

    Usage:
        >>> get_non_unique_numbers([1, 3, 1])
        1
        >>> get_non_unique_numbers([10, 3, 10, 30, 0, 30])
        [10, 30]
        >>> get_non_unique_numbers([1, 2, 3])
        Traceback (most recent call last):
            ...
        ValueError: no unique number in numbers
    """
    unique_numbers = set()
    non_unique_numbers = list()

    for number in numbers:
        if number in unique_numbers:
            non_unique_numbers.append(number)
        else:
            unique_numbers.add(number)

    if not non_unique_numbers:
        raise ValueError('no unique number in numbers')

    if len(non_unique_numbers) == 1:
        return non_unique_numbers[0]
    return non_unique_numbers