mpu6050 problem

I never had to deal with errors. I just return them in case they occur.
I think error 2 is from Wire.endTransmission() and indicates that a NACK is received after the address is send.

It could be a bad connection on the bread board.

Can you try the i2c_scanner : Arduino Playground - HomePage
Let it run for a while to see if it always can detect your sensor.

On the backside is a solder pad for PULLUP. I can't see in the photo if that is connected. It seems to connect the two 10k resistors to the 3.3V. You need those pull-up resistors.