State callback error message changed to include namespace and use proper <bad-element>
This commit is contained in:
parent
7ad16bd84b
commit
b78054e7cf
4 changed files with 38 additions and 14 deletions
|
|
@ -134,19 +134,25 @@ clixon_plugin_statedata(clicon_handle h,
|
|||
if (ret > 0 && (ret = xml_yang_validate_add(h, x, &xerr)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
if ((cberr = cbuf_new()) ==NULL){
|
||||
clicon_err(OE_XML, errno, "cbuf_new");
|
||||
goto done;
|
||||
cxobj *xe;
|
||||
cxobj *xb;
|
||||
|
||||
if ((xe = xpath_first(xerr, NULL, "//error-tag")) != NULL &&
|
||||
(xb = xml_body_get(xe))){
|
||||
if (xml_value_set(xb, "operation-failed") < 0)
|
||||
goto done;
|
||||
}
|
||||
if ((xe = xpath_first(xerr, NULL, "//error-message")) != NULL &&
|
||||
(xb = xml_body_get(xe))){
|
||||
if (xml_value_append(xb, " Internal error, state callback returned invalid XML") < 0)
|
||||
goto done;
|
||||
}
|
||||
cprintf(cberr, "Internal error: state callback returned invalid XML: ");
|
||||
if (netconf_err2cb(xpath_first(xerr, NULL, "rpc-error"), cberr) < 0)
|
||||
goto done;
|
||||
if (*xret){
|
||||
xml_free(*xret);
|
||||
*xret = NULL;
|
||||
}
|
||||
if (netconf_operation_failed_xml(xret, "application", cbuf_get(cberr))< 0)
|
||||
goto done;
|
||||
*xret = xerr;
|
||||
xerr = NULL;
|
||||
goto fail;
|
||||
}
|
||||
#if 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue