Error Definition Object/ Create custom messages

Error Definition Object/ Create custom messages

How can I handle my own exceptions using a specific error message?