def read_file(file_path, ignore_error=False):
    """Safely read file and return empty str in case ignore_error fla is set."""
    try:
        with open(file_path, encoding="utf-8") as file:
            return file.read()
    except OSError as err:
        if ignore_error:
            return ''
        raise err