Fixed customized errors: fcgi and snmp
This commit is contained in:
parent
5bdad1870e
commit
978586a493
3 changed files with 5 additions and 3 deletions
|
|
@ -151,7 +151,7 @@ restconf_main_config(clicon_handle h,
|
|||
if ((ret = clixon_xml_parse_string(inline_config, YB_MODULE, yspec, &xrestconf, &xerr)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
clixon_netconf_error(xerr, "Inline restconf config", NULL);
|
||||
clixon_netconf_error(h, xerr, "Inline restconf config", NULL);
|
||||
goto done;
|
||||
}
|
||||
/* Replace parent w first child */
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ snmp_scalar_get(clicon_handle h,
|
|||
goto done;
|
||||
/* Detect error XXX Error handling could improve */
|
||||
if ((xerr = xpath_first(xt, NULL, "/rpc-error")) != NULL){
|
||||
clixon_netconf_error(xerr, "clicon_rpc_get", NULL);
|
||||
clixon_netconf_error(h, xerr, "clicon_rpc_get", NULL);
|
||||
goto done;
|
||||
}
|
||||
x = xpath_first(xt, nsc, "%s", xpath);
|
||||
|
|
|
|||
|
|
@ -1772,10 +1772,12 @@ netconf_err2cb(clicon_handle h,
|
|||
{
|
||||
int retval = -1;
|
||||
cxobj *x;
|
||||
size_t len;
|
||||
|
||||
len = cbuf_len(cberr);
|
||||
if (clixon_plugin_netconf_errmsg_all(h, xerr, cberr) < 0)
|
||||
goto done;
|
||||
if (cbuf_len(cberr) == 0){
|
||||
if (cbuf_len(cberr) == len){ /* Same as on-entry, use default */
|
||||
if ((x=xpath_first(xerr, NULL, "//error-type"))!=NULL)
|
||||
cprintf(cberr, "%s ", xml_body(x));
|
||||
if ((x=xpath_first(xerr, NULL, "//error-tag"))!=NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue