I'm not Cathe, but I am a personal trainer, do stop and don't lift and see your doctor. There are many may causes of a headache, this could be high blood pressure only when lifting, tensing your neck or gritting your teeth when you lift, having had some type of back of the head or neck trauma, bone alignment, we all twist our back or neck and here that pop and feel that release, our bodies are usually really good at getting us inline, but sometimes do to stress or activity our bodies can't move that bone 1/100th of an inch back to where it was, and this will cause a lot of pressure or sever headaches, your electrolytes being out of wack, or PMS or other hormone cycle are some of the causes.
And if you have migraines on occasion, that puts a whole new light on things.
But do get checked this isn't something that should be ignored, or brushed off to the side and hope it goes away. This can be very serious and you don't want to mess with your health in this way. Take the time to see a doctor explain how the headache feels, you may even want to write down every detail about the headache you can remember, before you go to the doctor, as it's a lot easier at home then trying to remember everything for the doctor. Also tell them each exercise you were doing and when you started to feel the headache come on and what exercise you had to stop doing because it got too bad. This will help pinpoint who or what is causing the headache. Or it be how heavy your weights are, as you maybe just out maxing your body with the weights, and it's just telling you, it can't do that much. I don't know what you're lifting compared to how much you weigh, so it's just one of the possibilities.
Good luck, and I hope it's just something very simple and easily taken care of.
Kit