def read_file(filepath, encoding="utf-8"):
    """Read text from a file."""
    try:
        with open(filepath, encoding=encoding) as f:
            return f.read()
    except FileNotFoundError as e:
        raise ValueError(f"File '{filepath}' does not exist.") from e