It all depends
What were you trying to accomplish. Best to document that before hand or you are likely to merge the outcome with your intent, but that is for another post.
For example. You go to Vegas and your INTENT is to have fun, not lose more than $500, and get a free buffet. You end up losing $400 and having the time of your life. Your trip was a success.
Now imagine your goal was to make $10,000 for the trip to fund a start-up. Your exact same result of losing $400 and having the time of your life is now a massive failure.
Everything should be viewed through the lens of intent.
I have heard (and probably been guilty of a few) excuses, justifications also called retrospective coherence where people say that's what they were trying to do all along... MAYBE.. but be honest with yourself and you are better off in the long run.
"I just spent 2 years on a failed start-up and wasted $50,000" Retrospective coherence = "I just wanted to learn how to code"
Maybe you did. And maybe that route was the best way to learn how to code. Learning how to code is a righteous and important goal. And maybe it's a Pyrrhic victory. Maybe it's a good consolation prize. Maybe it was factored in to the "worst case scenario".
But try not to tell yourself after it was over that all you wanted to do was learn how to code, if really all you were trying to do was start a successful startup.