I have registered operational callbacks for getnext/object/elem… Whenever I get the callback with transaction context I see its set with above error code. Please let me know if I am missing something…
Old value = 0
New value = 4
0x00000000024c71a6 in clear_error ()
(gdb) bt #0 0x00000000024c71a6 in clear_error () #1 0x00000000024d911b in confd_fd_ready ()
I see above callback before calling my base function which is setting error to the transacation…
struct confd_error error; /* user settable via */
/* confd_trans_seterr*() */
Why? (It should perhaps have been in the “ConfD internal fields” section.) As the comment says, it will be set if your callback calls confd_trans_seterr() - and then it will be used, i.e. passed to ConfD, when/if your callback returns CONFD_ERR. If your callback returns CONFD_ERR without calling confd_trans_seterr() or related functions, the pre-set information will be used. And if you read the section “EXTENDED ERROR REPORTING” in the confd_lib_lib(3) man page, you will find:
A call of confd_trans_seterr(tctx, "string") is equivalent to
confd_trans_seterr_extended(tctx, CONFD_ERRCODE_APPLICATION, 0, 0,
"string").
from which yo can perphaps deduce that returning CONFD_ERR without calling any of the confd_trans_seterr*() functions is equivalent to having called
which is what the pre-set info corresponds to. Bottom line, your code should not look at this info at all (nor write it other than via the documented functions).
Hmm that I got, but my question is when my registered callback is invoked with tctx why the error code is set already ?. I am yet to process any information.
I’m sorry, I really don’t know what more to say since you don’t seem to understand what I’m saying. Can you please just ignore it? There is no reason whatsoever for your code to examine that data at all, there is no documentation that suggests otherwise, and the library code is working exactly as designed.