Add check for unsupported .doc files
This commit is contained in:
parent
14688457cd
commit
3f3cd7b9b2
1 changed files with 2 additions and 0 deletions
|
|
@ -27,6 +27,8 @@ class FileComponent(CustomComponent):
|
|||
def load_file(self, path: str, silent_errors: bool = False) -> Record:
|
||||
resolved_path = self.resolve_path(path)
|
||||
extension = resolved_path.split(".")[-1]
|
||||
if extension == "doc":
|
||||
raise ValueError("doc files are not supported. Please save as .docx")
|
||||
if extension not in TEXT_FILE_TYPES:
|
||||
raise ValueError(f"Unsupported file type: {extension}")
|
||||
record = parse_text_file_to_record(resolved_path, silent_errors)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue