Sayyiduna Nu'man bin Bashir (may Allah be pleased with him) says: The Messenger of Allah (peace and blessings be upon him) came hurriedly to the mosque dragging his cloak, and the sun had been eclipsed. He (peace and blessings be upon him) prayed until the sun became bright, and he (peace and blessings be upon him) said: "In the Jahiliyyah people used to say that the sun and the moon lose their light only because of some great person among the people of the earth, whereas the sun and the moon do not lose their light for anyone's death, for they are both creations of Allah, and Allah does in His creation whatever He wills. So whichever of them loses its light, pray until it becomes bright, or until Allah brings about some other matter."
This is more likely to be the preserved (mahfuz) version; it has also been said: from Abu Qilabah from Qabisah al-Hilali.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخسوف / 6337