This often used to imply the horrible "wide net" effect, when one uses too wide a net to catch exceptions (and even sometimes never dealt with them in order to get rid of them... but this never happens anymore :P ).
One interesting and possibly easy to integrate evolution to the java language would be the possibility to catch multiple exceptions in one go as follows:
catch([MyException,AnotherException] e){
throw new WrapperException("Something bad occured in my code, but I won't deal with it, though this gives you a context ;)",e);
}
In this case, in current java constructs, this would end up with:
catch(MyException e){
throw new WrapperException("Something bad occured in my code, but I won't deal with it, though this gives you a context ;)",e);
}catch(MyException e){
throw new WrapperException("Something bad occured in my code, but I won't deal with it, though this gives you a context ;)",e);
}
Or more probably because nobody likes repeated code:
catch(MyException e){
dealWithException(e);
}catch(MyException e){
dealWithException(e);
}
Or even for lazy people:
catch(Exception e){
throw new WrapperException("Something bad occured in my code, but I won't deal with it, though this gives you a context ;)",e);
}
I vote for it... do you? ;)
