global-functions: $GetMacVendor: :do ... on-error=... -> :onerror ... do=...

This commit is contained in:
Christian Hesse 2025-05-08 09:26:53 +02:00
parent a6b36dde7b
commit 7a1fef78a2

View file

@ -586,12 +586,12 @@
("https://api.macvendors.com/" . [ :pick $Mac 0 8 ]) output=user as-value ]->"data"); ("https://api.macvendors.com/" . [ :pick $Mac 0 8 ]) output=user as-value ]->"data");
:return $Vendor; :return $Vendor;
} on-error={ } on-error={
:do { :onerror Err {
/tool/fetch check-certificate=yes-without-crl ("https://api.macvendors.com/") \ /tool/fetch check-certificate=yes-without-crl ("https://api.macvendors.com/") \
output=none as-value; output=none as-value;
$LogPrint debug $0 ("The mac vendor is not known in database."); $LogPrint debug $0 ("The mac vendor is not known in database.");
} on-error={ } do={
$LogPrint warning $0 ("Failed getting mac vendor."); $LogPrint warning $0 ("Failed getting mac vendor: " . $Err);
} }
:return "unknown vendor"; :return "unknown vendor";
} }