There is a divine injunction on oaths, thoughtless oaths may be deemed to be void, deliberate/solemn oaths however need to be kept; failure to keep a solemn oath calls for expiation, as ordained:
‘’Allah will not call you to account for what is void in your oaths, but He will call you to account for your deliberate oaths: for expiation, feed ten indigent persons, on a scale of the average for the food for you families, or clothe them, or give a slave his freedom. If that is beyond your means, fast for three days. That is expiation for the oath ye have sworn. But keep your oaths. Thus doth Allah make clear to His Signs, that ye may be grateful’’ [Al Ma’idah:89]
We may refer to other Holy Verses reflecting on the same theme:
‘’Allah will not call you to account for thoughtlessness in your oaths, but for intention in your hearts, and he is Oft-Forgiving, Most Forbearing’’ [Al Baqarah: 225]
It is the intent in taking in taking an oath that matters, otherwise thoughtlessness in oaths is not accounted for by the Oft-Forgiving, Most Forbearing—Allah (SwT)
Thoughtlessness in oaths, even if taken in Allah (SwT)’s name may not stand in acting rightly, or making peace between persons, as explained in the preceding verse of Surah Al Baqarah:
'’And make not Allah’s (name) an excuse in your oaths against doing good, or acting rightly, or making peace between persons, for Allah is One Who hearth and knoweth all things’’ [Al Baqarah: 224]
It is related that Arabs were used to taking oaths that carried a definite name in their language. it also related to sex matters in matrimonial alliance, such as oath of abstinence, which would result in strains between two persons in the wedlock, thus it is ordained that Allah (SwT)’s name may not be taken as an excuse in acting rightly, in order to make peace between persons.