Another scenario is where a partner passes away, and you aren't able to cover the costs of a joint mortgage by yourself.
If one partner dies, even if you are in a joint mortgage, you won't necessarily be automatically responsible for all of the debt - although you will need to contact your lender if you'd like this to happen.
To take over 100% of the mortgage debt, your lender would need to assess your affordability, and agree to transfer the loan into your name.
In some cases, life insurance or savings can help, or there are other refinancing options available.