mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
fix: add error handling for logfile writes in Analytics
This commit is contained in:
parent
c51afc952c
commit
699e283890
1 changed files with 6 additions and 4 deletions
|
@ -219,7 +219,9 @@ class Analytics:
|
|||
"user_id": self.user_id,
|
||||
"time": int(time.time()),
|
||||
}
|
||||
# ai try/except OsErrors, ignore them AI!
|
||||
with open(self.logfile, "a") as f:
|
||||
json.dump(log_entry, f)
|
||||
f.write("\n")
|
||||
try:
|
||||
with open(self.logfile, "a") as f:
|
||||
json.dump(log_entry, f)
|
||||
f.write("\n")
|
||||
except OSError:
|
||||
pass # Ignore OS errors when writing to logfile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue