I have the same problem. All of sudden camera gives error "Camera error" with black screen and all you have is "Ok" and than camera closes. Sometimes it works from second try, sometimes not. Then you have to shut Moto G down and power it up again. Of course, the moment you wanted to capture is gone..
I did wipe cache, no result. Did factory reset, no result. Although camera didn't "crash" for the first 10-15 times but after that, it gave error.
Maybe to disable it and install some 3rd party camera app from Playstore? Will that help? Any suggestion on decent camera app to install? Even if it is few bucks but it's worth it, I'll buy it. But this camera error is frustrating!