fix(settings): move os.path.exists inside try block in update_env_file so exceptions are non-fatal

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/1f6c42dc-d64b-4263-a83a-f2263d865692
This commit is contained in:
copilot-swe-agent[bot]
2026-03-23 22:06:32 +00:00
parent c03ce8cdb2
commit c9bb2b6807
+4 -4
View File
@@ -3388,11 +3388,11 @@ def update_env_file(env_path: str, settings_to_update: dict[str, str]) -> bool:
Returns:
True if the file was successfully updated, False otherwise (e.g. file not found or write error)
"""
if not os.path.exists(env_path):
logger.warning(f".env file not found at {env_path}, skipping file update")
return False
try:
if not os.path.exists(env_path):
logger.warning(f".env file not found at {env_path}, skipping file update")
return False
logger.info(f"Updating settings in {env_path}")
# Read the current .env file