Was the camera working ok before? Did it happen after any specific even't, installation, drop, firmware upgrade?
If the phone is new and it just happened, I suggest you take it back to the place your bought it from. I have seen few people across different forums reporting camera errors or black outs, and in all cases it was hardware problem.