vpn: raise a clear error when no WireGuard config is configured

This commit is contained in:
Konstantin Passig PC
2026-08-25 15:31:31 +02:00
parent f6b271a926
commit a8568f2007
+7 -1
View File
@@ -62,7 +62,13 @@ def iface_name(cfg) -> str:
def conf_path(cfg) -> Path: def conf_path(cfg) -> Path:
return Path(cfg.vpn_wireguard).expanduser() wg = getattr(cfg, "vpn_wireguard", None)
if not wg:
raise RuntimeError(
"no WireGuard config configured: set [vpn] wireguard in the config "
"(run 'yt-downloader init' and edit the file)"
)
return Path(wg).expanduser()
def _host_link(iface: str) -> str: def _host_link(iface: str) -> str: