(… وَإِذَا جَاءَكَ الَّذِينَ يُؤْمِنُونَ بِآيَاتِنَا فَقُلْ سَلَامٌ عَلَيْكُمْ ) (And when those come to you who believe in Our verses, say, “Peace be upon you. …): Meaning, it is upon you to grant security, protection and reassurance on the Day of Resurrection, O you who have believed in Our verses and signs; the verses of the Holy Quran and the universal signs which prove the existence of Allah (swt).
(.. كَتَبَ رَبُّكُمْ عَلَىٰ نَفْسِهِ الرَّحْمَةَ… ) (…Your Lord has decreed upon Himself mercy:…): Nothing at all is like Allah (swt). The word Himself, in regards to the human being, refers to his soul and body. However, this meaning cannot be used for Allah (swt), as He does not have a self nor is He made up of parts. Also, as human beings, we may take agreements, deeds or vows upon ourselves, and then we sign a document with witnesses present. However, Allah (swt) can never have witnesses upon Himself, nor can anyone force him to bear witness over anything.
But in this verse, when He says that He has decreed Mercy upon Himself, it means that, out of His Mercy, He has allotted mercy for human beings and opened its door expansively for them.
Allah (swt) has opened the doors of mercy and forgiveness for the one who commits evil ignorantly, it is because, a person might commit evil due to a weakness in himself and not due to his persistence in committing the sin. Repentance is an act of the heart, while amendment is an act of the limbs. Therefore, repentance alone does not suffice, but amendment of the corruption one has carried out is also necessary. Thus, the legislation of repentance in Islam is a great act of reformation to the benefit of the individual and the community. As such, we find that the Prophet (saws) used to encourage people to repent and to ask for forgiveness in all their matters, and to then return to uprightness, as he (saws) said:
“All the sons of Adam are sinners, but the best of sinners are those who repent often.”
Therefore, Islam does not disapprove of people committing mistakes or doing evil deeds, but instead, disapproves of people persisting in them. And here is where Allah (swt) opens the door of His mercy. It was narrated by ‘Aishah (may Allah be pleased with her) that:
“Habib Ibn Harith came to the Messenger of Allah (saws) and said: O Messenger of Allah, I am a man who commits a lot of evil. He (saws) replied: “So repent to Allah, O Habib.” He said: O Messenger of Allah, I repent, and then I go back to committing the evil. He (saws) said: “Every time you commit the sin, repent.” He said, In that way, my sins will be a big number! He (saws) said: “Allah’s forgiveness is greater than your sins, O Habib Ibn Harith!” 
This is a show of the endless mercy of Allah (swt). He (swt) says in another verse:
وَنُنَزِّلُ مِنَ الْقُرْآنِ مَا هُوَ شِفَاء وَرَحْمَةٌ لِّلْمُؤْمِنِينَ
(We send down the Quran as a healing and mercy for the believers) (Al-Issraa: 82)
The Quran is a cure from physical diseases as well as communal diseases, i.e., diseases of moral values. As such, the Holy Quran is a cure and a mercy which prevents you from becoming ill, providing you hold fast to the commands of Allah (swt). This is what the verse means.
 Al-Mustadrak ‘ala as-Sahihain, Volume 4, page 272, Hadith No. 7617.
 Majma’ az-Zawaid wa Manba’ al-Fawaid, Volume 10, Hadith No. 17531.