I personally like to use exceptions for everything that should stop or change the program flow. In other words, if checking a specific field changes the data processing or requires a repetition of the process, I always use an exception to handle errors.
If this is trivial, or I'm just compiling a list of error messages, then I am not throwing an exception.
To answer the questions, two exceptions cannot be excluded at the same time. The first ejection expression to be achieved will be displayed. This does not mean that sometimes it makes no sense to reconstruct as another type of exception.
source share