From 53b6f7720ec33146581ceb878447d35d462c8697 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 15 Nov 2024 23:02:43 +0100 Subject: mode-button: catch runtime errors in executed code --- mode-button.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mode-button.rsc') diff --git a/mode-button.rsc b/mode-button.rsc index 84eb8ea..ac1fb4f 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -64,7 +64,11 @@ :delay 200ms; } - [ :parse $Code ]; + :do { + [ :parse $Code ]; + } on-error={ + $LogPrint warning $0 ("The code for " . $Count . " mode-button presses failed with runtime error!"); + } } else={ $LogPrint warning $0 ("The code for " . $Count . " mode-button presses failed syntax validation!"); } -- cgit v1.2.3-70-g09d2