It would be advised to try to catch the type of the thrown exception.
For example you want to catch zero division exception you can use DivideByZeroException .
Additively you might know what exception might get at a specific code path so you can test by providing erroneous data or right it down when you catch an exception so you can change it to the appropriate one.
Here is a list
https://mikevallotton.wordpress.com/...s-all-of-them/
Also to be fair it might be a lot of work to specify each an every one exception especially in a long exception code, so I would get at least the obvious one. But it's your choice. I tend to name catch the SQL exceptions as most of my work is done there.




Reply With Quote