Well, whomever shouldn't have screwed up in the first place.
But if you have, an older gentleman passed along some advice to me once on a completely unrelated subject that seems apt here. Whenever you are about to stir the hornet's nest and kick over the ant hill, ask yourself, "What exactly, am I trying to achieve?"
If you honestly ask yourself that question in regards to infidelity, most of the time it has little to do with honesty or your relationship. It's because you feel guilty, or you feel the need for absolution or forgiveness. You feel like a horrible person. Confessing is less about consideration for the other party, and more about selfishness in the need to assuage your conscience and make you feel better.
And selfishness is what got you into this predicament in the first place.