Leaf Reference Error Message

I have to add a customize message on leafref instance failures from “illegal reference” to my customized message. Is it possible?