def check_positive_int(string):
    """Convert a string to integer and check if it's positive. 
    
    Raise an error if not. Return the int.
    """
    
    if int(string) > 0:
        return int(string)
    else:
        raise RuntimeError("Integer must be positive.")