core: always handle method call params via sd_varlink_dispatch(), even if we accept none
This results in much more precise errors for the clients, and is what we do everywhere else these days.
This commit is contained in:
@@ -158,8 +158,9 @@ int vl_method_describe_manager(sd_varlink *link, sd_json_variant *parameters, sd
|
||||
|
||||
assert(parameters);
|
||||
|
||||
if (sd_json_variant_elements(parameters) > 0)
|
||||
return sd_varlink_error_invalid_parameter(link, parameters);
|
||||
r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
r = sd_json_buildo(&v,
|
||||
SD_JSON_BUILD_PAIR_CALLBACK("Context", manager_context_build_json, manager),
|
||||
|
||||
Reference in New Issue
Block a user