Narrated Abu Huraira: I heard Allah's Apostle saying. "All the sins of my followers will be forgiven except those of the Mujahirin (those who commit a sin openly or disclose their sins to the people). An example of such disclosure is that a person commits a sin at night and though Allah screens it from the public, then he comes in the morning, and says, 'O so-and-so, I did such-and-such (evil) deed yesterday,' though he spent his night screened by his Lord (none knowing about his sin) and in the morning he removes Allah's screen from himself."
Hadith Referenceصحيح البخاري / كتاب الأدب / 6069
Hadith Gradingمحدثین:أحاديث صحيح البخاريّ كلّها صحيحة
Hadith Commentary: (1) Among the attributes of Allah Ta’ala is the attribute of "Sitteer" (the Concealer), meaning He covers faults. Allah Ta’ala conceals many of His servant’s sins in this world, and likewise, in the Hereafter, He will not disgrace or expose His servants. However, there are some people who themselves expose their own faults; they commit sins and then, with brazenness and arrogance, publicize their sins, saying, “Last night I committed such-and-such sins.” This is shamelessness and audacity, which Allah Ta’ala will not forgive.
(2) Allah Ta’ala covers a servant’s sins only when the servant himself also covers his own sins. On the contrary, a person who publicizes his sins angers Allah Ta’ala. Allah Ta’ala will not cover his sins either. A person should, out of modesty before Allah Ta’ala and before people, refrain from publicizing his sins, so that Allah Ta’ala may grant him protection on the Day of Resurrection and not disgrace or humiliate him.
Source: Hidayat al-Qari: Commentary on Sahih Bukhari, Urdu, Page: 6069