Without knowing all the details, it sounds as if it is pretty much final and if it is I am sorry .
God is very specific about all the trials and tribulation that we will go through. So, having your faith shaken is a matter of choice. We humans make our own beds and we have to lay in them, God has nothing to do with your problem. But, I can assure you that He is very interested in how it affects your relationship with His son.
I would also say that if you are responsible for your marriage failure, remember that all sins were done away with at the cross, so God has already forgiven you. If it is your wife's or ex-wife's fault, the you need to forgive her.
I know that the failure is very difficult for you but, what you do from here is up to you, that is the test of your faith. And remeber that the word faith is sometimes misunderstood.
Paraphrasing, God says: " You are saved through faith (belief) in grace, which is a gift and not of your own works". So, do you beleive in grace, do you know what grace means here?
It is what St. Paul called the gospel that he had preached: " the death burial and resurrection of jesus Christ.
You need to study this and have an intiment understanding of this gospel but, basically:
Death at the cross forgives but not saves
Burial proves death
Resuurection provides you a way to recieve the life of God in you and thus gain salvation and eternal life.
If you understand the death and the burial and have personally recieved the resurrected life of Jesus Christ, then the Bible tells me that your faith can not be shaken, it can't even be stirred.
Blessngs