Netconf error callback resilient to prefixes
Reformat json code
This commit is contained in:
parent
e619632ac7
commit
7713e79dc2
3 changed files with 47 additions and 47 deletions
|
|
@ -249,20 +249,20 @@ example_cli_errmsg(clicon_handle h,
|
|||
int retval = -1;
|
||||
cxobj *x;
|
||||
|
||||
if ((x=xpath_first(xerr, NULL, "//error-type"))!=NULL)
|
||||
if ((x = xml_find_type(xerr, NULL, "error-type", CX_ELMNT)) != NULL)
|
||||
cprintf(cberr, "%s ", xml_body(x));
|
||||
if ((x=xpath_first(xerr, NULL, "//error-tag"))!=NULL)
|
||||
if ((x = xml_find_type(xerr, NULL, "error-tag", CX_ELMNT)) != NULL)
|
||||
cprintf(cberr, "%s ", xml_body(x));
|
||||
if ((x=xpath_first(xerr, NULL, "//error-message"))!=NULL)
|
||||
if ((x = xml_find_type(xerr, NULL, "error-message", CX_ELMNT)) != NULL)
|
||||
cprintf(cberr, "%s ", xml_body(x));
|
||||
if ((x=xpath_first(xerr, NULL, "//error-info")) != NULL &&
|
||||
if ((x = xml_find_type(xerr, NULL, "error-info", CX_ELMNT)) != NULL &&
|
||||
xml_child_nr(x) > 0){
|
||||
if (clixon_xml2cbuf(cberr, xml_child_i(x, 0), 0, 0, NULL, -1, 0) < 0)
|
||||
goto done;
|
||||
}
|
||||
if ((x=xpath_first(xerr, NULL, "//error-app-tag"))!=NULL)
|
||||
if ((x = xml_find_type(xerr, NULL, "error-app-tag", CX_ELMNT)) != NULL)
|
||||
cprintf(cberr, ": %s ", xml_body(x));
|
||||
if ((x=xpath_first(xerr, NULL, "//error-path"))!=NULL)
|
||||
if ((x = xml_find_type(xerr, NULL, "error-path", CX_ELMNT)) != NULL)
|
||||
cprintf(cberr, ": %s ", xml_body(x));
|
||||
retval = 0;
|
||||
done:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue