From d5f9ecebfbda885c4600ff99ee2713a5827e0398 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 8 May 2025 09:41:57 +0200 Subject: [PATCH] gps-track: :do ... on-error=... -> :onerror ... do=... --- gps-track.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gps-track.rsc b/gps-track.rsc index 4cc5066..6a090bf 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -34,7 +34,7 @@ :local Gps [ /system/gps/monitor once as-value ]; :if ($Gps->"valid" = true) do={ - :do { + :onerror Err { /tool/fetch check-certificate=yes-without-crl output=none http-method=post \ http-header-field=({ [ $FetchUserAgentStr $ScriptName ]; "Content-Type: application/json" }) \ http-data=[ :serialize to=json { "identity"=$Identity; \ @@ -42,8 +42,8 @@ $LogPrint debug $ScriptName ("Sending GPS data in " . $CoordinateFormat . " format: " . \ "lat: " . ($Gps->"latitude") . " " . \ "lon: " . ($Gps->"longitude")); - } on-error={ - $LogPrint warning $ScriptName ("Failed sending GPS data!"); + } do={ + $LogPrint warning $ScriptName ("Failed sending GPS data: " . $Err); } } else={ $LogPrint debug $ScriptName ("GPS data not valid.");