Sahih Bukhari Volume 7, Book 70, Hadith Number 544.
Narrated By ‘Aisha : (The wife of the Prophet) Allah’s Apostle said, “No calamity befalls a Muslim but that Allah expiates some of his sins because of it, even though it were the prick he receives from a thorn.”