For example, is it considered bad practice to write:
try
{
#some code
}
catch (Exception e){
#some code
}
Rather than
try
{
#some code
}
catch (ExceptionName e){ #like ArrayIndexOutOfBoundsException
#some code
}
I guess the question holds for pretty much every language, be it Python, C++, Java...Any thoughts?
I am asking because it seems to me that you shouldn't, since it means you don't know what kind of error you are handling and what to do with it, but I see some people do it.