May peace be upon you
As I understand it to be, God set the penalty for breaking oaths in the Ayaa below
"God does not take you to task for your inadvertent oaths, but He will take you to task for oaths you make intentionally. The expiation in that case is to feed ten poor people with the average amount you feed your family, or clothe them, or free a slave. Anyone without the means to do so should fast three days. That is the expiation for breaking oaths when you have sworn them. Keep your oaths. In this way Allah makes His Signs clear to you, so that hopefully you will be thankful." [5:89]
Hope that answers the question