If you get divorced, it is important to divide debt in the same way that you divide assets. You need to split things up with your ex so that the lenders eventually get what they are owed.
However, do not assume that a divorce agreement alone gets you out of the obligation. The lender does not care what it says. If you agreed to pay off that debt -- say it's a car loan with both of your names on it, for instance -- then they still hold you to that, even if your ex agreed to pay during the divorce.
For instance, one woman's ex decided to declare bankruptcy. This happened years after they finalized their divorce. However, one "very large debt" was still in both of their names. When he declared bankruptcy, the lenders started contacting her and demanding that she pay off everything that the couple still owed.
What the lender did, in that case, was legal. The woman was not actually off of her husband's debt. He just agreed to pay it. When he failed to do so, she was still obligated, just as she would have been during their marriage.
This is why it's so important to actually divide debts up by paying them off or moving them into one person's name alone. You want to end your divorce without any financial connections whatsoever.
The woman's case also shows why it is crucial that you understand what your divorce decree does and does not do. You must be fully aware of your legal options and your rights and obligations after the split.