cannot import non-text files!
build / build (push) Successful in 39s
pytest / pytest (push) Successful in 35s

This commit is contained in:
2026-04-24 18:40:51 +02:00
parent c6ad060e85
commit d71fce7a6a
3 changed files with 51 additions and 1 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
from plistlib import InvalidFileException
from typing import Annotated, Callable
import typer
@@ -122,7 +123,9 @@ def import_data(
except NotFoundError:
_fail(f"Collection '{collection}' does not exist.")
except FileNotFoundError:
_fail(f"The file {file} was not found.")
_fail(f"The file '{file}' was not found.")
except InvalidFileException:
_fail(f"The file '{file}' is not a text file.")
# ------------------------------------------------------------------------------