From daaf863d83acd8638a29b8bbf9d6bedb7fae40f2 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 5 May 2023 12:47:17 +0200 Subject: [PATCH] The 'ping' command-line requests the actor for better error info. --- main.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index c44b527..3f34673 100644 --- a/main.c +++ b/main.c @@ -230,13 +230,21 @@ int main(int argc, char *argv[]) } if (strcmp(cmd, "ping") == 0) { - xs *msg = msg_ping(&snac, url); + xs *actor_o = NULL; - enqueue_output_by_actor(&snac, msg, url, 0); + if (valid_status(actor_request(&snac, url, &actor_o))) { + xs *msg = msg_ping(&snac, url); - if (dbglevel) { - xs *j = xs_json_dumps_pp(msg, 4); - printf("%s\n", j); + enqueue_output_by_actor(&snac, msg, url, 0); + + if (dbglevel) { + xs *j = xs_json_dumps_pp(msg, 4); + printf("%s\n", j); + } + } + else { + srv_log(xs_fmt("Error getting actor %s", url)); + return 1; } return 0;