The Sun once was in eclipse during the Prophet SAW's time.
The Sahabah RA left their work. Even the young boys practicing archery, hastened towards the masjid to know what the Prophet SAW would do at that time.
The Prophet SAW started a Solat of two raka'ats, which was so long that some people fainted and fell down.
The Prophet SAW wept in his Solat and said:
"O, My Lord! Thou has said that Thou ouldst not punish them as long as I am with them and so long as they seek Thy forgiveness."
This refers to a verse in the Qur'an wherein Allah says:
"But Allah would not punish them while Thou art with them, nor will He punish them while they seek forgiveness." (Surah 8: Ayat 33)
He (SAW) then addressed the people saying:
"You should hasten for Solat whenever you happen to find the Sun or the Moon in eclipse. If you happen to know the signs of the Last Day as I do, then surely you would weep more and laugh less. In all such happenings, repair to Solat; pray to Allah and distribute alms to the poor."