i was getting the same error - not sure what fixed the situation but here is what I did:
go to software update and install all new software updates
disconnect all USB devices other than your iPhone
iTunes will then prompt for the iOS 5 upgrade - should be auto sensed, if not start iTunes
The upgrade should go smoothly at this point
A few items - none of my playlists were preserved once iOS 5 came up on my iPhone 4
I had to re-sync and select all my music
Too many issues so I did not try to move any content to iCloud
Wait for Apple to resolve the issues and bug fixes
On an original iPad WiFi 3g, it gets unknown error (1). I restarted, tried restore ten times, downloaded the OSX software, and it failed twice. I ran System Update and installed a new Safari 1.1 and some other thing that didn't seem related. It didn't help. Neither the regular restore nor the Option-Restore with the downloaded software fix the problem. I've been up all night and had no prior problems with the iPad. It is totally blanked out and non functional now. I don't know what to do next but go to sleep and hope there's a solution tomorrow.
Ok this is a temporary fix what I found out,
First download the iPhone Firmware from the following site, It is the official firmware and even downloads from Apple.
http://www.felixbruns.de/iPod/firmware/ - Choose your model, e.g iPhone 4
Now once that is downloaded go to the following folder -
C:\Users\YOURUSER\AppData\Roaming\Apple Computer\iTunes\iPhone Software Updates
Once you are they copy the file you just downloaded into it, then click Update. It will now skip the download process and will Update. I was having the same issue then I did this and its almost updated. Hope it helps