And Pharisees came up to him and tested him by asking, “Is it lawful to divorce one’s wife for any cause?” He answered, “Have you not read that he who made them from the beginning made them male and female, and said, ‘For this reason a man shall leave his father and mother and be joined to his wife, and the two shall become one’? So they are no longer two but one. What therefore God has joined together, let not man put asunder.” They said to him, “Why then did Moses command one to give a certificate of divorce, and to put her away?” He said to them, “For your hardness of heart Moses allowed you to divorce your wives, but from the beginning it was not so. And I say to you: whoever divorces his wife, except for unchastity [
porneia], and marries another, commits adultery; and he who marries a divorced woman, commits adultery.”
--Matthew 19:3-9
Matthew is right. But that has nothing to do with the law. If you got married by the state and the state is your god then the state does not need to hold your marriage together. But if you get married by God and you wish to do what God wants, then you should stay married even if your husband leaves you. Jesus says this in every Gospel.