Introduction
Custom error messages help you explain what went wrong in your program in a clear and friendly way.
When you want to tell the user why their input is not accepted.
When you want to make debugging easier by showing specific problems.
When you want to stop the program if something important is missing or wrong.
When you want to guide someone using your code on how to fix errors.
When you want to replace confusing default error messages with simple ones.