Everything would depend on the context. If I knew I had driven him to it by being neglectful, putting him last, putting him down, I could understand it.
If we had been (I thought) blissfully happy, great sex life, and it came like a bolt out of the blue, then probably not. Because if he could do that when everything was great, what hope could there possibly be?
Some people have affairs because the marriage has made them really miserable but they haven't left because they still love their partners and hold out hope for a better future. I think that's more understandable, if hardly ideal.
But some people say "I have a great spouse, I just want more" which makes me 😡and I hope those people rot in hell.
Put another way, it would depend on if the affair made sense or not. Bad marriage for two years or more? Possibly survivable. Greedy, entitled git? Almost certainly not.
Ideally, if the problems are so bad that someone is looking elsewhere, the spouse should sit their partner down and communicate HARD that they are at the end of their rope, and don't stop until the partner has heard them. But most people don't have such advanced communication skills, sadly.