When an exception is caught, I need to display a message and exit the program. Every case has its own message. The exception is raised by methods, therefor I use an exception class.
I understand that I can create one exception class with many Text Ids. Different methods will raise the exception class with a different Text Id. In that way it is possible to create only one exception class in the entire system.
My question is – What is the right design?
Is it recommended to create only one exception class in the entire system or is it better to create several exception classes? Maybe an exception class for each message class? Or a different division of exception classes?
Thanks in advance