diff options
| -rw-r--r-- | src/petthecord/cache.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/petthecord/cache.py b/src/petthecord/cache.py index d111e99..aa5618d 100644 --- a/src/petthecord/cache.py +++ b/src/petthecord/cache.py @@ -71,7 +71,10 @@ class CachedPet: if (path := self._cache.get(user.id)) != str(avatar_path): self._logger.debug("Generating new gif for {user.id}") if path: - remove(path) + try: + remove(path) + except OSError: + self._logger.warning("no {path} was found when replacing avatar") self._cache[user.id] = str(avatar_path) with open(self._path / "index.json", "w") as f: dump(self._cache, f) |