Ya most of the books which explan exception handling does say to catch proper exceptions. This is a way to make a person habituated of catching proper exception from the beginning.
The code and case which you have mentioned are very general. The action which you have taken on catching an exception is also very general. This is NOT the scenario in real world
JAVA coding. Many times you come across situations where you have to take some specific action on catching a specific exception and thats the reason why all the experts mention to catch the proper exception from the beginning.
Let me know if I have been able to answer the query.
Thanks and Regards,
Hiral