* Second fix of https://github.com/clicon/clixon/issues/158
* Actually there is an error of duplicate rpc-replies, but it should be detected in the backend not here
This commit is contained in:
parent
3c014184f7
commit
344dcacf6f
3 changed files with 13 additions and 5 deletions
|
|
@ -418,6 +418,10 @@ api_return_err(clicon_handle h,
|
|||
goto done;
|
||||
}
|
||||
}
|
||||
#if 1
|
||||
if (clicon_debug_get())
|
||||
clicon_log_xml(LOG_DEBUG, xerr, "%s Send error:", __FUNCTION__);
|
||||
#endif
|
||||
if (xml_name_set(xerr, "error") < 0)
|
||||
goto done;
|
||||
tagstr = xml_body(xtag);
|
||||
|
|
@ -431,7 +435,7 @@ api_return_err(clicon_handle h,
|
|||
goto done;
|
||||
switch (media){
|
||||
case YANG_DATA_XML:
|
||||
clicon_debug(1, "%s code:%d err:%s", __FUNCTION__, code, cbuf_get(cb));
|
||||
clicon_debug(1, "%s code:%d", __FUNCTION__, code);
|
||||
if (pretty){
|
||||
cprintf(cb, " <errors xmlns=\"urn:ietf:params:xml:ns:yang:ietf-restconf\">\n");
|
||||
if (clicon_xml2cbuf(cb, xerr, 2, pretty, -1) < 0)
|
||||
|
|
@ -446,7 +450,7 @@ api_return_err(clicon_handle h,
|
|||
}
|
||||
break;
|
||||
case YANG_DATA_JSON:
|
||||
clicon_debug(1, "%s code:%d err:%s", __FUNCTION__, code, cbuf_get(cb));
|
||||
clicon_debug(1, "%s code:%d", __FUNCTION__, code);
|
||||
if (pretty){
|
||||
cprintf(cb, "{\n\"ietf-restconf:errors\" : ");
|
||||
if (xml2json_cbuf(cb, xerr, pretty) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue