The sun eclipsed during the time of the Messenger of Allah ﷺ. He stood in great anxiety fearing that it might be the Doomsday, till he came to the mosque. He stood up to pray with prolonged qiyam, ruku', and prostration which I never saw him doing in prayer; and then he said: These are the signs which Allah sends, not on account of the death of anyone or life of any one, but Allah sends them to frighten thereby His servants. So when you see any such thing, hasten to remember Him, supplicate Him and beg pardon from Him, and in the narration transmitted by Ibn 'Ala the words are:" The sun eclipsed"."" He frightens His servants." (Using translation from Muslim 912)
كَسَفَتِ الشَّمْسُ عَلَى عَهْدِ رَسُولِ اللهِ ﷺ فَقَامَ فَزِعًا يَخْشَى أَنْ تَكُونَ السَّاعَةَ حَتَّى أَتَى الْمَسْجِدَ فَقَامَ يُصَلِّي بِأَطْوَلِ قِيَامٍ وَرُكُوعٍ وَسُجُودٍ مَا رَأَيْتُهُ يَفْعَلُهُ فِي صَلَاةٍ قَطُّ ثُمَّ قَالَ إِنَّ هَذِهِ الْآيَاتِ الَّتِي يُرْسِلُ اللهُ لَا تَكُونُ لِمَوْتِ أَحَدٍ وَلَا لِحَيَاتِهِ وَلَكِنَّ اللهَ أَرْسَلَهَا يُخَوِّفُ بِهَا عِبَادَهُ فَإِذَا رَأَيْتُمْ مِنْهَا شَيْئًا فَافْزَعُوا إِلَى ذِكْرِ اللهِ وَدُعَائِهِ وَاسْتِغْفَارِهِ