# Path: src/stratis_cli/_errors.py
# class StratisCliEnvironmentError(StratisCliError):
#     """
#     Exception that occurs during processing of environment variables.
#     """


from .._errors import StratisCliEnvironmentError


def get_timeout(value):
    """
    Turn an input str or int into a float timeout value.

    :param value: the input str or int
    :type value: str or int
    :raises StratisCliEnvironmentError:
    :returns: float
    """

    maximum_dbus_timeout_ms = 1073741823

    # Ensure the input str is not a float
    if isinstance(value, float):
        raise StratisCliEnvironmentError(
            "The timeout value provided is a float; it should be an integer."
        )

    try:
        timeout_int = int(value)

    except ValueError as err:
        raise StratisCliEnvironmentError(
            "The timeout value provided is not an integer."
        ) from err

    # Ensure the integer is not too small
    if timeout_int < -1:

# Path: src/stratis_cli/_errors.py
# class StratisCliEnvironmentError(StratisCliError):
#     """
#     Exception that occurs during processing of environment variables.
#     """


# Path: src/stratis_cli/_actions/_environment.py
from .._errors import StratisCliEnvironmentError



def get_timeout(value):
    """
    Turn an input str or int into a float timeout value.

    :param value: the input str or int
    :type value: str or int
    :raises StratisCliEnvironmentError:
    :returns: float
    """

    maximum_dbus_timeout_ms = 1073741823

    # Ensure the input str is not a float
    if isinstance(value, float):
        raise StratisCliEnvironmentError(
            "The timeout value provided is a float; it should be an integer."
        )

    try:
        timeout_int = int(value)

    except ValueError as err:
        raise StratisCliEnvironmentError(
            "The timeout value provided is not an integer."
        ) from err

    # Ensure the integer is not too small
    if timeout_int < -1:

        raise StratisCliEnvironmentError(