Sharp pain & cramping

Mama

Was having sharp pain and cramping yesterday went to the ER to make sure everything is good. I had an ultrasound saw my baby(fetus) heart beat 167 bpm (I'm 7 weeks 5 days) but after running test the doc said because of the sharp pains & cramping she said it was a threatening miscarriage I'm a reck...worried. Anybody else been thru this and continued with their pregnancy?