Thursday, October 10, 2002 02:13 PM
As I see it, the smaller the try block, the more granularity you have, of writing more specific handler code in the catch block, for the specific code in the try block.
And with smaller, more specific try blocks, you can be confident that you have safely completed the code in your earlier try block, when debugging.
But then, the larger the try block, the less messy the code is.
So it is a trade-off, to balance these two factors, in your particular situation.
You might want to group a few of your exception-throwing calls (with the intervening safe code) into a small number of try blocks, by how they are related and how it makes your code better, as a compromise, between one huge try block around the whole method on the one hand, or all individual try blocks for each call, on the other hand.