From 0bb52bf8aea74644073749b0ca38bc9624623119 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 16 Oct 2026 14:37:39 -0700 Subject: [PATCH] wireguard: Throw exception when client can't be added - Sometimes a newly added client can't be found even after waiting 10 seconds. In these cases the changes are mostly lost. Raise an exception instead showing that the client has been added. Tests: - When client adding fails, exception is raised instead of successfully showing the result page. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- freedombox/modules/wireguard/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freedombox/modules/wireguard/utils.py b/freedombox/modules/wireguard/utils.py index c61d4bfa0..c77ef1c11 100644 --- a/freedombox/modules/wireguard/utils.py +++ b/freedombox/modules/wireguard/utils.py @@ -373,7 +373,8 @@ def add_client(public_key): time.sleep(1) else: - logging.warning('Could not add client %s', public_key) + logging.warning('Error adding client %s', public_key) + raise RuntimeError('Error adding client') def remove_client(public_key):