This is my scenario, I have a list of exceptions of contains arbitrary exceptions like from different hierarchy, and the bellow code snaps will explain what I need to do
private List<java.lang.Class> connectionExceptions;
try {
// trying to connect to external module;
} catch(Exception e) {
// Need to compare this exception e with a list of exceptions which I have,
// and the action depends on the results. There may be some other exception
// which are not in the list.
}
So, how can I compare the exceptions, I need to some sort of actions if the exception is in the list or some other...
I know, control flow depends on the exception is not good practice. But, I need to do it.