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:
Well, I had to scrap the CALLBACK function because of the consideration of overhead time.
I truely want to change the ErrorPrefix of hidden leaves which cannot be seen by customers, while the unhidden leaves` error-messages could display as original.
If you want to change the error message for hidden leaves only, one alternative can be to use the tailf:meta-data / value extensions in the YANG model in combination with the error formating callback that you register with ConfD.
How often will an error be triggered in your use case? Normally it is not a very frequent event.