From c9bb2b6807b371d04edff12d16f838f411b60514 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 22:06:32 +0000 Subject: [PATCH] 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 --- app/utils/settings_service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/utils/settings_service.py b/app/utils/settings_service.py index cec83c24..75c64481 100644 --- a/app/utils/settings_service.py +++ b/app/utils/settings_service.py @@ -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