Multiple or Single Try Catch [duplicate]
I always try to reduce levels of nesting for readability and maintainability. If you have n try/catch blocks, each handling the same type of exception, why not refactor the code that can throw the exception into methods…it would look something like: try { firstBatchOfTricky(); secondBatchOfTricky(); …. nthBatchOfTricky(); } catch (ItWentBoomException e) { // recover from … Read more