Was it just something I ate ?

So I don’t know if it was my pill or something I ate that made me vomit, I take my pill every night at 8 O’clock I’ve been taking it for about 4 days now. I haven’t once threw up from it. But the other day I took my pill at 8 but woke up at 1am with horrible stomach pains. (Before this I recently had hanks (It’s a really greasy food place) I had a burger and fries and some clam cakes. If you don’t know what clam cakes are they are nothing like crab cakes. It’s like pieces of clam deep fried they are actually pretty good) At first when I woke up I thought my stomach might of just been hurting from my pill but then I was like man it feels like i’m gonna throw up and after 30 minutes I was like shit i’m gonna throw up, so I hopped to the bathroom (I fractured my ankle so i’m on crutches) and chunky vomit came out of my mouth and plopped into the toilet I barfed up everything I ate and afterwards I felt fine. Like my stomach didn’t hurt anymore and I had some water and went back to sleep. My sister also complained about the food making her stomach hurt but she didn’t barf. My question is was it the food or my pill ? and did my pill still work or did I throw it up ?