def construct_error_message(files_dict):
    """Function to construct an error message pointing out where bad latin
	phrases appear in lines of text

	Arguments:
		files_dict {dictionary} -- Dictionary of failing files containing the
		                           bad latin phrases and offending lines

	Returns:
		{string} -- The error message to be raised
	"""
    error_message = ["Bad latin found in the following files:\n"]

    for file in files_dict.keys():
        error_message.append(
            f"{file}:\t{files_dict[file]['latin_type']}\tfound in line\t[{files_dict[file]['line']}]\n"
        )

    return "\n".join(error_message)