Jones was quoted as saying; " I never learned anything from winning a golf tournament." How incredible is that. The only person in the history of professional golf to win all major championships in the same year stated that winning taught him nothing!
What he meant of course, is that losing is a teachable and defining moment. The pain of failure is a great motivator, to the right person. Whenever we do not accomplish that which we set out to do, we may consider ourselves to be failures. Instead of taking the position that you have irrevocably failed, consider yourself as the student and that the painful experience has taught you that you will need to do things either, better or differently, or both, in order to achieve your objective. Don't consider it a complete loss, consider it an opportunity to grow in your abilities as you adapt and improve.
Learning is indeed a process and that process is going to be as productive or as unproductive as you make it. Failures are great teachers.