If your failure is not a lesson, it's indeed a failure.
The greatest reward for a man's failure is not necessarily the consequent success, but what he becomes by it.
Failure does not connote that you achieved nothing. It denotes that you are on an adventure towards finding what will eventually advance you to the realization of your goals.
That failure serves a purpose!