A believer does not receive (the trouble) of running a thorn or more than that but Allah elevates him in rank or effaces his sins because of that. (Using translation from Muslim 2572b)
قَالَ رَسُولُ اللهِ ﷺ لَا يُصِيبُ الْمُؤْمِنَ شَوْكَةٌ فَمَا فَوْقَهَا إِلَّا رَفَعَهُ اللهُ ﷻ بِهَا دَرَجَةً وحَطَّ عَنْهُ بِهَا خَطِيئَةً