summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-05 12:47:17 +0200
committerdefault <nobody@localhost>2023-05-05 12:47:17 +0200
commitdaaf863d83acd8638a29b8bbf9d6bedb7fae40f2 (patch)
tree0d2fcd0858195e82d49311420dd106c30afd0dc3 /main.c
parent8cd79df272645da70cfe2980d6f9c0c33c13e452 (diff)
The 'ping' command-line requests the actor for better error info.
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files 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;