you have to provide further information about the phone mate.
-FIrst of all what is the firmware version and modem version of the phone?
-What error code are you talking about?
-What firmware did you restore the phone with?
-If is in recovery mode with the itunes logo and a usb cable connection then do this
-Download Ireb from this link
-Run it and selevt fix recovery loop button which is situated at the bottom right of the application interface.
-The choose your mobile version in this case Iphone 3G and click on that button
-This will restart your phone and it will kick out the recovery mode.