Piyush Porwal wrote:From what I have read in the books, a try..catch block should consists of minimal code which can throw an exception. So if return is not expected to throw any exception, it should be outside of the try block. If you are doing something funky in the return like as simple as
then move it out only when you do not expect Dog constructor to throw an exception or if you do not want to catch it.
A great answer in my opinion

, I've seen too many times where people simply wrap the entire code block in try/catch, not always necessary!