Ash-Shama'il Al-Muhammadiyah, Book 35, Hadith 233 (In-Book)

Ali ibn Rabiah radiyallahu anhu says, I was present when a conveyance (A horse or something) was brought to Hazrat Ali radiyallahu anhu (in the period of his khilafah). He recited Bismillah and put his leg in the stirrup. After he had mounted he said Alhamdulillah and recited this dua: Translation: Glorified be He Who hath sudued those unto us, and we were not capable (Of subduing them); And lo! Unto our Lord we are returning. (Surah Zukhruf 13-14)(The ulama say that a conveyance could be a means of death. Therefore subjugation of a conveyance with gratitude towards Allah for His Mercy, and death are mentioned together. After all a person has to return to Allah after death). Ali radiyallahu anhu then said Alhamdulillah three times, Allahu Akbar three times, then recited:Translation: Glorified be Thou! Behold, I have wronged myself. So forgive thou me. Indeed, non forgiveth sins but Thou.Then (Sayyidina Ali radiyallahu anhu) laughed (smiled). I said to him, "What is the reason for laughing, O Ameerul Mumineen?" He replied, "Rasoolullah sallallahu alaihe wasallam also recited these duas in this manner and thereafter laughed (smiled). I also inquired from Rasoolullah sallallahu alaihe wasallam the reason for laughing (smiling) as you have asked me. Rasoolullah sallallahu alaihe wasallam said, "Allah Ta'ala becomes happy when His servants say, 'No one can forgive me save You.' My servant knows that no one forgives sins besides me.

حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، قَالَ‏:‏ حَدَّثَنَا أَبُو الأَحْوَصِ، عَنْ أَبِي إِسْحَاقَ، عَنْ عَلِيِّ بْنِ رَبِيعَةَ، قَالَ‏:‏ شَهِدْتُ عَلِيًّا، أُتِيَ بِدَابَّةٍ لِيَرْكَبَهَا فَلَمَّا وَضَعَ رِجْلَهُ فِي الرِّكَابِ، قَالَ‏:‏ بِسْمِ اللهِ، فَلَمَّا اسْتَوَى عَلَى ظَهْرِهَا، قَالَ‏:‏ الْحَمْدُ لِلَّهِ، ثُمَّ قَالَ‏:‏ سُبْحَانَ الَّذِي سَخَّرَ لَنَا هَذَا وَمَا كُنَّا لَهُ مُقْرِنِينَ وَإِنَّا إِلَى رَبِّنَا لَمُنْقَلِبُونَ، ثُمَّ قَالَ‏:‏ الْحَمْدُ لِلَّهِ ثَلاثًا، وَاللَّهُ أَكْبَرُ ثَلاثًا، سُبْحَانَكَ إِنِّي ظَلَمْتُ نَفْسِي، فَاغْفِرْ لِي فَإِنَّهُ لا يَغْفِرُ الذُّنُوبَ إِلا أَنْتَ، ثُمَّ ضَحِكَ فَقُلْتُ‏:‏ مِنْ أَيِّ شَيْءٍ ضَحِكْتَ يَا أَمِيرَ الْمُؤْمِنِينَ‏؟‏ قَالَ‏:‏ رَأَيْتُ رَسُولَ اللهِ صلى الله عليه وسلم صَنَعَ كَمَا صَنَعْتُ ثُمَّ ضَحِكَ، فَقُلْتُ‏:‏ مِنْ أَيِّ شَيْءٍ ضَحِكْتَ يَا رَسُولَ اللهِ‏؟‏ قَالَ‏:‏ إِنَّ رَبَّكَ لَيَعْجَبُ مِنْ عَبْدِهِ، إِذَا قَالَ‏:‏ رَبِّ اغْفِرْ لِي ذُنُوبِي، إِنَّهُ لا يَغْفِرُ الذُّنُوبَ غَيْرُكَ‏.‏‏.‏

also referenced under: Book 34, Hadith 223 (English)