From a8568f200769300822296461652568e4bc1e41b0 Mon Sep 17 00:00:00 2001 From: Konstantin Passig PC <2002erdi@gmail.com> Date: Tue, 25 Aug 2026 15:31:31 +0200 Subject: [PATCH] vpn: raise a clear error when no WireGuard config is configured --- yt_downloader/vpn.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yt_downloader/vpn.py b/yt_downloader/vpn.py index e99faeb..84bf0d5 100644 --- a/yt_downloader/vpn.py +++ b/yt_downloader/vpn.py @@ -62,7 +62,13 @@ def iface_name(cfg) -> str: 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: