See the confd_lib_lib(3) man page, section “EXTENDED ERROR REPORTING” and the examples.confd/dp/error_formatting example for guidance on how to manipulate error messages.
See also this post from 5 years ago: How to hide the path of leaf in error-message - #2 by cohult