you need to identify what you ate, how soon you ate, any supplements you took, were you hydrated etc. and make sure you don't do that again. throwing up during a workout and you are finished for the day. they body will not want to continue working out
i recommend have a light and balanced meal 45-1 hour pre workout when weight training and 2 hours+ before endurance sports. something like a couple eggs, a sweet potato and a piece of fruit works