small changes in error messages and code documentation

This commit is contained in:
Olof hagsand 2020-07-14 19:46:12 +02:00
parent 94ad44a2ea
commit 863ebd3f93
5 changed files with 250 additions and 7 deletions

View file

@ -236,8 +236,21 @@ clixon_plugin_statedata_all(clicon_handle h,
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((ret = clixon_plugin_statedata_one(cp, h, nsc, xpath, &x)) < 0)
goto done;
if (ret == 0)
if (ret == 0){
if ((cberr = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;
}
/* error reason should be in clicon_err_reason */
cprintf(cberr, "Internal error, state callback in plugin %s returned invalid XML: %s",
cp->cp_name, clicon_err_reason);
if (netconf_operation_failed_xml(&xerr, "application", cbuf_get(cberr)) < 0)
goto done;
xml_free(*xret);
*xret = xerr;
xerr = NULL;
goto fail;
}
if (x == NULL)
continue;
if (xml_child_nr(x) == 0){