diff --git a/src/CacheLibrary/CacheLibrary.py b/src/CacheLibrary/CacheLibrary.py index 89b3b5b..2d48b3e 100644 --- a/src/CacheLibrary/CacheLibrary.py +++ b/src/CacheLibrary/CacheLibrary.py @@ -102,6 +102,10 @@ def __init__( path = Path(file_path) + if path.is_dir(): + msg = f"Cache file path must be a file. '{path.resolve().as_posix()}' is a directory." + raise ValueError(msg) + if path.suffix == ".json": self.cache_file = JsonCacheFile( path,