Confusion about scope in try-catch blocks