Skip to content

Commit 451f3ef

Browse files
committed
Revert "Do not expect the cache folder to exist"
This reverts commit bdce6b3.
1 parent 1980cfe commit 451f3ef

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

plugwise_usb/helpers/cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def cache_root_directory(self, cache_root_dir: str = "") -> None:
4848
async def initialize_cache(self) -> None:
4949
"""Set (and create) the plugwise cache directory to store cache file."""
5050
if self._root_dir != "":
51+
if not await ospath.exists(self._root_dir):
52+
raise CacheError(f"Unable to initialize caching. Cache folder '{self._root_dir}' does not exists.")
5153
cache_dir = self._root_dir
5254
else:
5355
cache_dir = self._get_writable_os_dir()

0 commit comments

Comments
 (0)