Key Violation Error Message

I am relatively new to Delphi and have a question that I hope is easy
to answer.  I need to expand the "Key Violation" error message after
attempting to post a record (i.e. provide user with a message about
the key field and the fact that duplicates are not allowed).  Where do
I put the code and how to I write it?

Thank you for your assistance.