Tax on 401k early distribution to pay off loan

I was ordered to take a 401k loan in a 2016 divorce decree of $20k - $10k to go to my Ex & $10k me to pay off credit cards from marriage. I lost my job 06/2019, I did a rollover of funds to another IRA but had to payoff the loan of $22,000 by distribution of funds so this shows as income.  My Ex never pd a dime of the $10k he received from the 401k loan that he was ordered to pay to me each month. Is there a tax exception due to this as I would not have had to pay this loan off if not for divorce agreement. 

 

Thanks!