Asim bin Damrah narrates that Sayyiduna Ali (may Allah be pleased with him) said: Whoever feels a disturbance in his stomach or vomits should leave and come back after performing ablution. If he has not spoken in the meantime, he should continue from where he left off, and if he has spoken, he should start the prayer afresh.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3385