robust error handling

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
import this
2025-11-14 10:36:23 +00:00
committed by GitHub
parent 3f560180b7
commit 054715a600
+6 -2
View File
@@ -96,8 +96,12 @@ class NodeSetupCLI:
if ip.returncode == 0 and ip.stdout.strip():
updated["PUBLIC_IP"] = ip.stdout.strip()
os.environ["PUBLIC_IP"] = ip.stdout.strip()
except Exception:
pass
except subprocess.TimeoutExpired:
print("[WARN] Timeout expired while trying to fetch public IP with curl.")
except FileNotFoundError:
print("[WARN] 'curl' command not found. Please install curl or set PUBLIC_IP manually.")
except subprocess.CalledProcessError as e:
print(f"[WARN] Error while running curl to fetch public IP: {e}")
# write all collected variables to env.sh in one go
self._upsert_env_vars(updated, env_file)