We were with the Messenger of Allah ﷺ when the sun was eclipsed. The Messenger of Allah ﷺ went out trailing his cloak until he reached the mosque, and the people gathered around him. He led us in two units of prayer, and when the sun became clear again, he said, "The sun and the moon are two of Allah's signs by which Allah frightens His servants. They do not eclipse for the death or life of anyone. So when you see that, pray until what afflicts you is removed."This happened because a son of his named Ibrahim had died, and people had been saying something about that.
أخبرنا عمران بن موسى قال حدثنا عبد الوارث قال حدثنا يونس عن الحسن
كنا عند رسول الله ﷺ فانكسفت الشمس فخرج رسول الله ﷺ يجر رداءه حتى انتهى إلى المسجد وثاب إليه الناس فصلى بنا ركعتين فلما انكشفت الشمس قال إن الشمس والقمر آيتان من آيات الله يخوف الله عز وجل بهما عباده وإنهما لا يخسفان لموت أحد ولا لحياته فإذا رأيتم ذلك فصلوا حتى يكشف ما بكم وذلك أن ابنا له مات يقال له إبراهيم فقال له ناس في ذلك
Bukhari transmitted it in the Book of Eclipse, chapter titled "Prayer during a lunar eclipse," Hadith no. 1063, from the hadith of Abdul-Warith with this same chain, and it is also found in Kubra, Hadith no. 1876.