def _resolve_oct(value: str) -> int:
    """
    Resolves an octal string to a numeric value (e.g. for umask or mode).
    Raises a ValueError if the value is malformed.

    Parameters
    ----------
    value
        The octal string value

    Returns
    -------
    int
        The numeric representation of the octal value
    """
    try:
        return int(value, 8)
    except ValueError:
        raise ValueError(f"Invalid value '{value}': Must be in octal format.")