How to hide the path of leaf in error-message

Yes. You need to do this change in an error formating callback that you register with ConfD in which you then format errors with the code “CONFD_ERR_MUST_FAILED”.

See confd_lib_dp man page section “ERROR FORMATTING CALLBACK” (also available as an appendix in the ConfD UG).
You have an example under “confd_error_seterr” that changes the “CONFD_ERR_TOO_MANY_ELEMS” error. You can do the same thing but for “CONFD_ERR_MUST_FAILED”.
Also note that you can for example check the context of the user, e.g. if the context is cli in the “struct confd_user_info”.

In addidtion, even though you didn’t ask for it, you can change the “Aborted:” prefix too. See confd.conf man page:
/confdConfig/cli/addErrorPrefixSuffix
/confdConfig/cli/cErrorPrefix
/confdConfig/cli/jErrorPrefix

1 Like