Important yet confusing question?

So I had a miscarriage at 5 weeks a few days after having an UTI. I don’t think the UTI had anything to do with it, but it was a bad and painful one, I miscarried right as I found out I had a BAD UTI. Since I was only 5 weeks was this considered a chemical pregnancy or a full on miscarriage?