The answer depends upon the nature of the debt. Certainly, alimony cannot be discharged in bankruptcy, nor can child support. But when a payment to a spouse is not termed alimony or child support, the question of dischargeability is muddied.
Ordinary debts to a spouse are usually dischargeable, so if, for example you have agreed to pay to your spouse a sum of money to balance the distribution of assets, that debt would ordinarily be dischargeable. But, if the bankruptcy court were to determine that a particular debt to a former spouse is in the nature of support, that debt might not be dischargeable. The “lawyer language” of “usually” and “might”, etc., above is the result of some recent changes in the bankruptcy laws and some recent rulings by the bankruptcy courts. Just because you (in your settlement agreement) or the court (in a Final Judgment of divorce after trial) put a label on a specific debt as ordinary does not bind the bankruptcy court from looking at it with fresh eyes and determining on its own what is the nature of the debt. If paying that debt is deemed by the bankruptcy court to be a form of spousal support, it is likely that the debt will not be dischargeable.