From 3be07f4f40ab24899c38fb06a357918bd2a1ef82 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 15 Jan 2023 17:53:34 +0000 Subject: [PATCH] ctl-server: Improve error messages for missing arguments --- src/ctl-server.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ctl-server.c b/src/ctl-server.c index 5607906..ccb84ec 100644 --- a/src/ctl-server.c +++ b/src/ctl-server.c @@ -138,8 +138,7 @@ static struct cmd_set_output* cmd_set_output_new(json_t* args, { const char* target = NULL; if (json_unpack(args, "{s:s}", "output-name", &target) == -1) { - jsonipc_error_printf(err, EINVAL, - "required: \"output-name\""); + jsonipc_error_printf(err, EINVAL, "Missing output name"); return NULL; } struct cmd_set_output* cmd = calloc(1, sizeof(*cmd)); @@ -152,8 +151,7 @@ static struct cmd_disconnect_client* cmd_disconnect_client_new(json_t* args, { const char* id = NULL; if (json_unpack(args, "{s:s}", "id", &id) == -1) { - jsonipc_error_printf(err, EINVAL, - "required: \"id\""); + jsonipc_error_printf(err, EINVAL, "Missing client id"); return NULL; } struct cmd_disconnect_client* cmd = calloc(1, sizeof(*cmd));