You can either fail, or learn a lesson.
The moment you begin looking for the lesson is the moment you stop failing. Failure is not the opposite of success; it is an intimate part of the process of being successful.
The only time you fail, is when you do not learn what the experience is trying to teach you.
Learn, and move forward.