mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
fix: Handle JSONDecodeError when loading model cache file
This commit is contained in:
parent
38fd715247
commit
93c284a67d
1 changed files with 5 additions and 1 deletions
|
@ -153,7 +153,11 @@ class ModelInfoManager:
|
|||
if self.cache_file.exists():
|
||||
cache_age = time.time() - self.cache_file.stat().st_mtime
|
||||
if cache_age < self.CACHE_TTL:
|
||||
self.content = json.loads(self.cache_file.read_text())
|
||||
try:
|
||||
self.content = json.loads(self.cache_file.read_text())
|
||||
except json.JSONDecodeError:
|
||||
# If the cache file is corrupted, treat it as missing
|
||||
self.content = None
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue