Overdoing it with exercises?

My obgyn gave me the ok to do weight training with a 25 lb limit. I was off and on before pregnancy but the past two weeks have been going 2-3x week. Anyways today I was doing squats with 10 pound weight total and was dropping low. After the 2nd set of 8 I realized I was out of breath, sweaty and my heart was racing. I took a few mins to cool off have some water and then I did my 3rd set. I felt fine the rest of the time at the gym. When I got home I had some minor tightness and cramp but it went away and there was no bleeding. Well now my anxiety got the worst of me and I’m thinking I possibly harmed baby. How do you keep yourself in check when working out? I keep forgetting to take it easy and I’m concerned I could do harm.