Where's the finish line?

When I was in college I started a project to connect car workshops with customers. Since I like cars I fell in love with the idea, which by the way was stupid. My hypothesis (aka guess) about the problem in the market was wrong, therefore the product sucked. Usually that’d the way to get started, you test a hypothesis and build a prototype, if it fails you keep iterating the process. My mistake was that I persisted with the idea and didn’t move on early on.
A few years later I started working on a private outlet for car parts. Again, I loved the idea. For other reasons this project didn’t take off. I had several mistakes, but one of them was to not stick with it a bit longer and find a way around.
The lesson here is that sometimes is hard to tell whether to stick with a project or throw it away. There’s no right answer though. But going a bit further usually pays off, the finish line might be around the corner.