Stolen from the web ...
"Try cleaning the electrical contacts on both the lens and the camera. A problem here usually gives the very general warning "err99". This should fix things for you. You can even try another lens as the first thing you do and if it works then you know it's the original lens. But if it does not work, don't be put off as it may also be dirt on your electric contacts on your camera body at this point. Clean all the contacts on your camera lens mount and also clean all the contacts on all your lenses.
Some use a pencil eraser and gently rub the contacts, or you can use a clean, lint free cloth lens cloth and maybe a little lens cleaning solution on it. Just rub the contacts with the damp cloth, not for too long. Wipe dry both the camera and lens contacts and check your results.
Other reasons for err99 are trying to achieve auto focus too close, at least that had happened to me with some at least one lens. Another reason in my experience was using an older chipped sigma lens that need's a new chip to work with current eos bodies. These 30yr old lenses still work but only at the wide open aperture, changing the aperture to anythiung else and you get err99. Canon , I belive lists many reasons for the gerneral err99 so do not worry to much.
"