mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
fix: Improve error handling in load_dotenv_files function
This commit is contained in:
parent
25c3a959dd
commit
d063be23c9
1 changed files with 6 additions and 6 deletions
|
@ -274,14 +274,14 @@ def load_dotenv_files(git_root, dotenv_fname, encoding="utf-8"):
|
|||
)
|
||||
loaded = []
|
||||
for fname in dotenv_files:
|
||||
if Path(fname).exists():
|
||||
try:
|
||||
try:
|
||||
if Path(fname).exists():
|
||||
load_dotenv(fname, override=True, encoding=encoding)
|
||||
loaded.append(fname)
|
||||
except OSError as e:
|
||||
print(f"OSError loading {fname}: {e}")
|
||||
except Exception as e:
|
||||
print(f"Error loading {fname}: {e}")
|
||||
except OSError as e:
|
||||
print(f"OSError loading {fname}: {e}")
|
||||
except Exception as e:
|
||||
print(f"Error loading {fname}: {e}")
|
||||
return loaded
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue