It is reported that Shurayh may Allaah have mercy on him said,
“If I am afflicted with a calamity, I praise Allaah for it four times: I praise Him because it wasn’t worse than it was, I praise Him when He gives me the patience to bear it, I praise Him for enabling me to say al-istirjaa’ (‘To Allaah we belong and to him we will return’; see Al-Baqarah: 154-156 ) in hope of a great reward, and I praise Him for not making it a calamity in my religion.”
Al-Dhahabee, Siyar A’laam Al-Nubalaa`, in his biography of Shurayh Al-Qaadee.
Source: http://www.sayingsofthesalaf.net/index.php/praise-be-to-allah-for-this-calamity/#ixzz2H2BtHaer