Most antibiotics are safe to take during pregnancy especially when the risks of not treating an infection are possible higher than the treatment. Depending upon the antibiotic taken during pregnancy the risks will differ, but in most cases complications of NOT taking the antibiotic are higher than taking it. Risks depend on which antibiotic you take, so that's something to discuss with your doctor.
Depending upon the antibiotic taken during pregnancy the risks will differ. Very rare side effects caused by antibiotic use during pregnancy include jaundice, damage to fetal cartilage, damage to fetal joint development and discoloration of fetal teeth.
Just because these fetal effects have been noted with the use of certain antibiotics does not mean they will happen in every case. If an infection cannot be treated with an antibiotic that falls into the safest categories for pregnant women, an antibiotic will be used that will effectively treat the infection. In this case, the obstetrician will cover the possible effects of the antibiotic on the fetus before starting the pregnant mother on a series of the medication.
The gestational age of the fetus will affect the potential damage from the antibiotic. The earlier in the pregnancy the antibiotic is taken, the higher the chance of risk to the fetus.
Unfortunately, if the mother has no other option but to take a medication with known risk factors for the fetus, that is a risk the obstetrician and the mother will need to discuss. Every infection needs to be diagnosed by the obstetrician. An infection left untreated can result in harm to the fetus and harm to the mother.
Pregnant women should also never consider taking a medication that is not prescribed by the obstetrician for illness during pregnancy. Just because the pregnant mom has an antibiotic from the same infection at another time does not mean that medication is safe for use during pregnancy.