from typing import Union


def _value_to_int(value: Union[int, str]) -> int:
    """String value to int."""
    try:
        return int(value)
    except ValueError as error:
        raise Exception("The value is not integer")