Certainly right in general, however imho not if a value is to be returned: having the return statement outside the try-catch gives the compiler extended deduction possibilities und imho is the better practice. But to return it the var must be declared outside.