* Fixed: Some restconf errors were wrongly formatted such as: {"ietf-restconf:errors":{"error":{"rpc-error": . There should be no "rpc-error" level.

This commit is contained in:
Olof hagsand 2020-02-26 21:33:31 +01:00
parent a71c256898
commit 86e251f30b
3 changed files with 35 additions and 9 deletions

View file

@ -263,8 +263,10 @@ api_data_get2(clicon_handle h,
if (netconf_invalid_value_xml(&xerr, "application", "Instance does not exist") < 0)
goto done;
/* override invalid-value default 400 with 404 */
if (api_return_err(h, r, xerr, pretty, media_out, 404) < 0)
goto done;
if ((xe = xpath_first(xerr, NULL, "rpc-error")) != NULL){
if (api_return_err(h, r, xe, pretty, media_out, 404) < 0)
goto done;
}
goto ok;
}
switch (media_out){