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)
إِنَّ رَسُولَ اللهِ ﷺ قَالَ مَا مِنْ مُسْلِمٍ يُشَاكُ شَوْكَةً فَمَا فَوْقَهَا إِلَّا رَفَعَهُ اللهُ بِهَا دَرَجَةً وَحَطَّ عَنْهُ بِهَا خَطِيئَةً