17 “If I said, My foot has slipt; Your mercy, O Lord, held me up”. See how God loves confession. Your foot has slipt, and you say not, my foot has slipt; but you say you are firm, when you are slipping. The moment you begin to slip or waver, confess thou that slip, that you may not bewail your total fall; that He may help, so that your soul be not in hell. God loves confession, loves humility. You have slipped, as a man; God helps you, nevertheless: yet say, “My foot has slipt.”
Why do you slip, and yet sayest, I am firm? “When I said, My foot has slipt, Your mercy, O Lord, has held me up.” Just as Peter presumed, but not in strength of his own. The Lord was seen to walk upon the sea, trampling on the heads of all the proud in this life. In walking upon the foaming waves, He figured His own course when He tramples on the heads of the proud. The Church too does trample upon them: for Peter is the Church Herself. Nevertheless, Peter dared not by himself walk upon the waters; but what said he?
“Lord, if it be Thou, bid me come unto You on the water.” He in His own power, Peter by His order; “bid me,” he says, “come unto You.” He answered, “Come.” For the Church also tramples on the heads of the proud; but since it is the Church, and has human weakness, that these words might be fulfilled, “If I said, My foot has slipt,” Peter tottered on the sea, and cried out, “Lord, save me!” and so what is here put, “If I said, My foot has slipt,” is put there, “Lord, I perish.”
And what is here, “Your mercy, O Lord, has held me up,” is there put, “And immediately Jesus stretched forth His hand, saying, O thou of little faith, wherefore did you doubt?” It is wonderful how God proves men: our very dangers render Him who rescues us sweeter unto us. For see what follows: because he said, “If I said, My foot has slipt, Your mercy, O Lord, has held me up.” The Lord has become especially sweet unto him, in rescuing him from danger; and thus speaking of this very sweetness of the Lord, he exclaims and says, “O Lord, in the multitude of the sorrows that I had in my heart, Your comforts have refreshed my soul”. Many sorrows, but many consolations: bitter wounds, and sweet remedies.
Source: The Enarrations, or Expositions, on the Psalms (New Advent)