From d1e72da0bde9728deaa88f28c1a3b6dd1ead960f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 5 May 2025 18:01:29 +0200 Subject: [PATCH] mode-button: fail if global functions do not become ready Co-authored-by: Ilya Kulakov --- mode-button.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mode-button.rsc b/mode-button.rsc index edc5f400..411bc4d2 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -10,7 +10,8 @@ # https://rsc.eworm.de/doc/mode-button.md :global GlobalFunctionsReady; -:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:onerror e { :retry { :if ($GlobalFunctionsReady != true) \ + do={ :error "Global functions not ready."; }; } delay=500ms max=20; } do={ :log error $e; }; :local ExitOK false; :do {