From f865245e5cbc252f80ec4b60ccd18f59f4162f92 Mon Sep 17 00:00:00 2001 From: James Haggerty Date: Tue, 24 Sep 2024 04:45:48 +0000 Subject: [PATCH] wizard-config: (APP-3457, PR #861) don't log exception in this reasonably normal situation If we're connecting to a normal device (i.e. not Artini) then the wizard-config service won't be running. Since this is not really an exceptional situation, don't spew stacktraces (that end up in syslog). Approved-by: Sophronia Koilpillai Approved-by: Evan Benn --- utils/wizard-config/files/sbin/wizard-config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/wizard-config/files/sbin/wizard-config b/utils/wizard-config/files/sbin/wizard-config index a774fdb..a23f2ce 100755 --- a/utils/wizard-config/files/sbin/wizard-config +++ b/utils/wizard-config/files/sbin/wizard-config @@ -409,7 +409,10 @@ function fetch_config(url) { function find_service_url(ubus, dhcp_server_ipv4) { const services = find_services(ubus, SERVICE); - assert(services && length(services) > 0, `Unable to find a '${SERVICE}' service; doing nothing\n`); + if (!services || length(services) === 0) { + print(`Unable to find a '${SERVICE}' service; doing nothing\n`); + exit(1); + } const url = get_url_from_service(get_best_service(services, dhcp_server_ipv4)); assert(url, `Unable to construct valid wizard config URL from service: ${services}\n`);