aboutsummaryrefslogtreecommitdiffstats
path: root/sms-action
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-02-26 15:51:29 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-02-26 15:51:29 +0100
commite76b52e3b08d1e66c47a067040071ffb95b1b528 (patch)
tree3aa77acd3045fca778c824401588be4d95667a84 /sms-action
parent8e005452672bda1f1cd7fd2e7957ce6bdff934ee (diff)
sms-action: use $ValidateSyntax
Diffstat (limited to 'sms-action')
-rw-r--r--sms-action13
1 files changed, 8 insertions, 5 deletions
diff --git a/sms-action b/sms-action
index 2d2600d..e48c632 100644
--- a/sms-action
+++ b/sms-action
@@ -13,6 +13,7 @@
:global SmsAction;
:global LogPrintExit2;
+:global ValidateSyntax;
:local Action $action;
@@ -21,8 +22,10 @@
}
:local Code ($SmsAction->$Action);
-:local Parsed [ :parse $Code ];
-
-:log info ("Acting on SMS action '" . $Action . "': " . $Code);
-:delay 1s;
-$Parsed;
+:if ([ $ValidateSyntax $Code ] = true) do={
+ :log info ("Acting on SMS action '" . $Action . "': " . $Code);
+ :delay 1s;
+ [ :parse $Code ];
+} else={
+ $LogPrintExit2 warning $0 ("The code for action '" . $Action . "' failed syntax validation!") false;
+}