Ok here's the problem. I had a jailbroken iPhone 3G and I'm trying to upgrade to the latest firmware for the 3G which is 4.2 but every time iTunes gives me the 1015 error.
Now the iPhone has the "connect to iTunes screen" and I can't do anything to get it back.