Al-Hasan (may Allah have mercy on him) said concerning the saying of Allah Almighty, "Allah will not take you to account for what is vain in your oaths" [Surah al-Baqarah: 225]: a man swears about something but it is not so; for that there is neither expiation nor being taken to account. Rather, being taken to account is for (swearing) with knowledge.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19944