He divorced his wife while she was menstruating, and Umar mentioned this to the Messenger of Allah ﷺ. The Messenger of Allah ﷺ became angry and then said, "Order him to take her back, then keep her until she becomes pure, then menstruates again, then becomes pure once more. After that, if he wishes, he may divorce her while she is pure and before he has touched her. That is the divorce in accordance with the waiting period as Allah has commanded."
حدثنا أحمد بن صالح حدثنا عنبسة حدثنا يونس عن ابن شهاب أخبرني
أنه طلق امرأته وهي حائض فذكر ذلك عمر لرسول الله ﷺ فتغيظ رسول الله ﷺ ثم قال مره فليراجعها ثم ليمسكها حتى تطهر ثم تحيض فتطهر ثم إن شاء طلقها طاهرا قبل أن يمس فذلك الطلاق للعدة كما أمر الله عز وجل
Bukhari narrated it in the Book of Judgments, Chapter, "May the judge issue a ruling or a legal opinion while angry", hadith 7160, from the hadith of Yunus bin Yazid, and Muslim narrated it in the Book of Divorce, Chapter, "The prohibition of divorcing a menstruating woman without her consent", hadith 4/1471, from the hadith of Ibn Shihab Zuhri, with the same chain.